X Units
Last updated
Last updated
The X Units variable controls how a unit is horizontally positioned relative to its parent. By default an object is positioned relative to the left of its parent, where each unit represents 1 pixel.
The following shows a child ColoredRectangle positioned 50 PixelsFromLeft relative to its parent:
The following shows a child ColoredRectangle positioned 50 PixelsFromCenterX relative to its parent:
The following shows a child ColoredRectangle positioned 50 PixelsFromRight relative to its Parent:
The following shows a child ColoredRectangle positioned 50 PercentageWidth relative to its Parent. In other words, it will be positioned halfway between the left and right edges of the Parent: