WoW:XML/Anchor: Difference between revisions
(Created page with "An Anchor is also a fundamental UI building block for defining positional layout for UI elements of LayoutFrames. An Anchor is an element of the [[XML/Anchors...") |
(CategorySelect - Adding categories) |
||
| Line 36: | Line 36: | ||
* x | * x | ||
* y | * y | ||
[[Category:XML elements]] | |||
Revision as of 06:17, 27 July 2012
An Anchor is also a fundamental UI building block for defining positional layout for UI elements of LayoutFrames. An Anchor is an element of an Anchors array defined in a LayoutFrame. Anchor XML elements, as a part of Anchors array, can be defined on any LayoutFrame or LayoutFrame type, which also includes Frames, Textures, and FontStrings.
- Example:
<Frame name="MyFrame">
<Frames>
<Frame name="$parentChild">
<Anchors>
<Anchor point="TOP">
<Offset>
<AbsDimension x="0" y="-22" />
</Offset>
</Anchor>
<Anchor point="BOTTOM">
<Offset>
<AbsDimension x="0" y="22" />
</Offset>
</Anchor>
</Anchors>
</frame>
</Frames>
</Frame>
This example will align the top of the 'child' frame to the top of 'MyFrame', and the bottom of 'child' to the bottom of 'MyFrame', and then offset that alignment by 22 vertically on both of those sides. This example would effectivly cause the child to stretch vertically to match its parent frame in wow, no matter how the parent frame changed size or position. Using anchors in this way lets wow automatically partially or wholely manage the actual position and size of the child.
Inheritance
Inherited by: none, Inherits: none, Defined in: LayoutFrame > Anchors
Elements
- <Offset>
Attributes
- point
- relativeTo
- relativePoint
- x
- y