====== Position literals to align with Parent Objects ====== Using literals for object positioning adds flexibility for placing an object relative to its parent, without having to do manual calculations. This is especially useful in the context of UI. Furthermore, when a Parent is defined for an object, you can use the same literals for Position as with Pivot to align object inside parent's borders. The global form is: Position = [pivot's override ->] Position's in parent space Here's a basic setup with one rectangular parent (green) and one rectangular child (red): [Parent] Color = lime green Size = (400, 300) Pivot = center ChildList = Child [Child] Color = orange red Size = (200, 150) Pivot = center Position = (0, 0, -0.1) And its result (nothing unusual so far): {{ :tutorials:objects:literals01.png?direct&600 |}} The Pivot of each rectangle will be highlighted with a small lighter colored square Let's try a few things and see the results [Parent] Pivot = center [Child] Pivot = center Position = top right {{ :tutorials:objects:literals02.png?direct&600 |}} [Parent] Pivot = center [Child] Pivot = top left Position = top left {{ :tutorials:objects:literals03.png?direct&600 |}} [Parent] Pivot = left [Child] Pivot = bottom right Position = top left (10, 10, -0.1) {{ :tutorials:objects:literals04.png?direct&600 |}} [Parent] Pivot = left [Child] Pivot = bottom left Position = bottom right -> bottom left {{ :tutorials:objects:literals05.png?direct&600 |}} [Parent] Pivot = left [Child] Pivot = (20, 20) Position = (100, 100) -> bottom left -0.1 {{ :tutorials:objects:literals06.png?direct&600 |}} [Parent] Pivot = left [Child] UseParentSpace = position Pivot = center Position = top right -> (0, 0.1) {{ :tutorials:objects:literals07.png?direct&600 |}} [Parent] Pivot = left [Child] Pivot = (20, 20) Scale = 0.5 Rotation = 30 Position = bottom right -> bottom left -0.1 {{ :tutorials:objects:literals08.png?direct&600 |}} One last for the road.... [Parent] Pivot = left Rotation = -30 Scale = 0.5 [Child] UseParentSpace = position Pivot = top right Scale = 2 Rotation = 30 Position = bottom right -> bottom left (0.25, 0, 0.1) {{ :tutorials:objects:literals09.png?direct&600 |}}