WoW:Layer: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(copied from XML user interface, added another api reference)
(Typo fixing, Replaced: <br> → <br /> (5) using AWB)
Line 1: Line 1:
There are 3 levels of layers: BACKGROUND is in the back, ARTWORK is in the middle and OVERLAY is in front. If you want to be sure that a object is before another, you must specify the level where you want to place it.
There are 3 levels of layers: BACKGROUND is in the back, ARTWORK is in the middle and OVERLAY is in front. If you want to be sure that a object is before another, you must specify the level where you want to place it.


BACKGROUND - Level 0. Place the background of your frame here. <br>
BACKGROUND - Level 0. Place the background of your frame here. <br />
BORDER - Level 1. Place the artwork of your frame here . <br>
BORDER - Level 1. Place the artwork of your frame here . <br />
ARTWORK - Level 2. Place the artwork of your frame here. <br>
ARTWORK - Level 2. Place the artwork of your frame here. <br />
OVERLAY - Level 3. Place your text, objects, and buttons in this level. <br>
OVERLAY - Level 3. Place your text, objects, and buttons in this level. <br />
HIGHLIGHT - Level 4. Place your text, objects, and buttons in this level. <br>
HIGHLIGHT - Level 4. Place your text, objects, and buttons in this level. <br />


*Elements in the '''HIGHLIGHT''' Layer are '''automatically shown or hidden''' when the mouse enters or leaves.
*Elements in the '''HIGHLIGHT''' Layer are '''automatically shown or hidden''' when the mouse enters or leaves.

Revision as of 20:10, 11 April 2009

There are 3 levels of layers: BACKGROUND is in the back, ARTWORK is in the middle and OVERLAY is in front. If you want to be sure that a object is before another, you must specify the level where you want to place it.

BACKGROUND - Level 0. Place the background of your frame here.
BORDER - Level 1. Place the artwork of your frame here .
ARTWORK - Level 2. Place the artwork of your frame here.
OVERLAY - Level 3. Place your text, objects, and buttons in this level.
HIGHLIGHT - Level 4. Place your text, objects, and buttons in this level.

  • Elements in the HIGHLIGHT Layer are automatically shown or hidden when the mouse enters or leaves.
  • For Highlighting to work you need enableMouse="true" in your <Frame> attributes.

Layer can be set on creation using the <Layers> tag in XML, or the "layer" parameter in Frame:CreateTexture(). To change the layer after creation, use the LayeredRegion:SetDrawLayer() function.

Note: The above are capitalized for a reason. See example:

<Layers>
  <Layer level="BACKGROUND">
    ...
  </Layer>
  <Layer level="ARTWORK">
    ...
  </Layer>
  <Layer level="OVERLAY">
    ...
  </Layer>
</Layers>