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 | edit source]

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

Elements[edit | edit source]

  • <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 | edit source]

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

Summary[edit | edit source]

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 | edit source]

<Frame name="MyFrame">
    <RelDimension x="0.5" y="0.5"/>
    <Frame name="$parentChild">
      <Size x="200" y="100"/>
        <Anchor point="TOP">
            <AbsDimension x="0" y="-22" />

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 | edit source]

Community content is available under CC-BY-SA unless otherwise noted.