This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gdevelop5:behaviors:anchor [2018/10/21 20:39]
gdevelop5:behaviors:anchor [2019/08/01 00:55] (current)
heather [Anchor Behavior]
Line 1: Line 1:
 # Anchor Behavior # Anchor Behavior
-Anchor behavior allows ​an object to retain it's position no matter ​the screen ​size/aspect ratio of the game, by clipping it'​s ​edges (BottomLeftRightTop). This is most useful for UI/HUD objects ​that are static.+You can anchor ​an object to the screen by using anchor behavior to pin its edges (bottomleftrightor topto the window edges. Once anchored, if the screen size changes, the distance between the edge of the object and the edge of the window will stay the same. This is useful for static ​UI/HUD objects.
-To add Anchor to an object, first open the object properties by creating a new object or by accessing the object in the Scene Object list. Select “Edit object” from the popup list. Then select “Behaviors” and click the add behavior button.+## Anchoring ​an object ​to the screen
-{{ :​gdevelop5:​behaviors:​anchorbehavior.png?​400 |}}+To add an anchor to an object: 
 +  * Right-click on the object in the Objects Panel (or create a new object) and select **Edit object**. 
 +  * Click on the **Behaviors** tab. 
 +  * Click **+** to add a behavior to the object. 
 +  * Select **Anchor**. 
 +  * Set your anchor points and click **Apply**. 
 +{{ :​gdevelop5:​behaviors:​anchorbehavior.png?​ |}}