WoW:XML/Dimension

From AddOn Studio
< XML
Revision as of 04:49, 15 August 2023 by Move page script (talk | contribs) (Move page script moved page XML/Dimension to XML/Dimension without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.

Inheritance[edit]

Inherited by: none, Inherits: none, Defined in: multiple

Elements[edit]

  • <AbsDimension> - defines a relative or absolute value, using 'absolute' unit based coordinates
  • <RelDimension> - defines a relative or absolute value, using 'relative' scalar coordinates

Attributes[edit]

  • x (int) - defines a value thats horizontally opposed
  • y (int) - defines a value thats vertically opposed

Summary[edit]

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.

Example[edit]

<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.

Details[edit]