Wikia

WoWWiki

XML/Anchor

Talk0
102,230pages on
this wiki

< XML

Revision as of 07:32, September 28, 2012 by Celess22 (Talk | contribs)

XML UI ← XML types < Anchor < Anchors

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.

Inheritance

Inherited by: none, Inherits: none, Defined in: LayoutFrame > Anchors

Elements

Attributes

  • point (FRAMEPOINT)
  • relativeTo (string) - global name of LayoutFrame to make relative to.
  • relativeKey (string) - uses a Lua name of reference to make relative to. alternate to 'relativeTo'. See LayoutFrame for 'parentKey'.
  • relativePoint (FRAMEPOINT)
  • x (int)
  • y (int)

Summary

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.

Around Wikia's network

Random Wiki