WoW:XML/Dimension
← XML UI ← XML types < Dimension
Dimension is a type used for a variety of purposes for defining values that relate to the UI coordinate system, and is a fundamental UI building block for defining positional layout. See Value for single value use type. The Dimension type can be used for Size, Position and others, and can be found on LayoutFrame, Anchor, and others.
InheritanceEdit
Inherited by: none, Inherits: none, Defined in: multiple
ElementsEdit
- <AbsDimension> - defines a relative or absolute value, using 'absolute' unit based coordinates
- <RelDimension> - defines a relative or absolute value, using 'relative' scalar coordinates
AttributesEdit
- x (int) - defines a value thats horizontally opposed
- y (int) - defines a value thats vertically opposed
SummaryEdit
Dimension based elements facilitate the 'Layout' mechanism in the WoW UI. When used for <Size>, along with the <Anchors> element, allow WoW to position all of its visible and interactive elements on the screen, including the 3D views of the world. Dimension works by providing a flexible set of size or positional constructs, by using one of: inline values (X and Y), the AbsDimension element, or the RelDimension element.
ExampleEdit
<Frame name="MyFrame"> <Size> <RelDimension x="0.5" y="0.5"/> </Size> <Frames> <Frame name="$parentChild"> <Size x="200" y="100"/> <Anchors> <Anchor point="TOP"> <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 then offset that alignment by -22 vertically. Also demonstrates use of Dimension with Size and Anchor, and using Abs, Rel and inline values.