Hello guest! Login or Register
Construct 2 r90

Released Friday, May 11, 2012 at 2:01:09 PM

28mb for Windows XP, Vista & 7

Free Download
Download Manual

Coming Soon

Anchor behavior


The Anchor behavior is useful for automatically positioning objects relative to the window size. This is useful for supporting multiple screen sizes. For more information on features to support multiple screen sizes, see the tutorial Supporting multiple screen sizes.

The Anchor behavior only has a useful effect when the Fullscreen in browser project property is set to either On (crop mode) or On (scale mode).

Positioning objects relative to the window size


In the top-left of the Layout View, a dotted outline represents the default size of the game window. Anchored objects should be positioned inside the dotted window area, as shown below.

Positioning some objects with the Anchor behavior.
Now if the window is resized during preview, the objects maintain their relative positions, as shown below:

Anchor responding to window size.
This is useful for interface elements like notifications and heads-up displays (HUDs).

Relative positioning


The Left edge and Right edge position the object relative to the window corners, without changing the object size. For example, if the Left edge is set to Window right, the object will always stay the same distance from the right edge of the window.

The Right edge and Bottom edge resize the object relative to the window corners. For example, if you want a Tiled Background to stretch wider as the window widens, set Right edge to Window right.

Anchor conditions, actions and expressions


The Anchor object has a single action:

Set enabled
Set whether the behavior is enabled or disabled. If disabled, the behavior will not alter the size or position of the object.

Previous Entry
8 direction
Next Entry
Bound to layout

Feedback on this page
How useful was this page for you?
Do you have any suggestions for this page?