Thread Tools Display Modes
11-25-10, 07:56 PM   #1
barbol12
A Cyclonian
 
barbol12's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 42
layering frames..

hello guys, i have some frames near each other in a bundle... but i want to layer them in certain order but i cant figure it out.. they are all in the strata BACKGROUND and i tried to set them to SetFrameLevel() but it didnt work for some reason... so i tried setting them all at different frama stratas instead... still didnt work...


also i have 1 other question.... i have the frames set to parent the GameMenuFrame (aka show up when options frame shows up) but they wont move with the options frame though.... how can i make them auto move(and keep relative position with the options frame?
  Reply With Quote
11-26-10, 12:07 PM   #2
Xubera
A Cobalt Mageweaver
 
Xubera's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 207
Originally Posted by barbol12 View Post
hello guys, i have some frames near each other in a bundle... but i want to layer them in certain order but i cant figure it out.. they are all in the strata BACKGROUND and i tried to set them to SetFrameLevel() but it didnt work for some reason... so i tried setting them all at different frama stratas instead... still didnt work...
:SetFrameLevel() does work, but you cannot use it on layers. Rendering works like this...

Frames are rendered based on Strata, frames in the same strata are drawn in order of frame level, and then the layers are based on layer level.

so you can set your frame's strata to DIALOG and have the layer on background, and it will show up above other frames because the layer is drawn to the BACKGROUND of the frame with a Strata of DIALOG.

if you have many textures where overlapping isnt going as you like, put the lower frames on a frame such as

Code:
<Frame name="lowerTextures" frameStrata="DIALOG" frameLevel="10">
    <Layers>
      <Layer level="BACKGROUND">
        <!--These textures are the lowest-->
      </Layer>
      <Layer level="OVERLAY">
        <!--These are above the BACKGROUND textures-->
      </Layer>
    </Layers>
  </Frame>

  <Frame name="higherTextures" frameStrata="DIALOG" frameLevel="20">
    <Layers>
      <Layer level="BACKGROUND">
        <!--These textures are lowest on this frame, but higher than overlay on other frame.-->
      </Layer>
      <Layer level="OVERLAY">
        <!--These textures are the highest of em all-->
      </Layer>
    </Layers>
  </Frame>
of course if there is a dialog frame with a framelevel between 10 and 20, it will be drawn in between your 2 frames, but you can just make the numbers closer together...

Originally Posted by barbol12 View Post
also i have 1 other question.... i have the frames set to parent the GameMenuFrame (aka show up when options frame shows up) but they wont move with the options frame though.... how can i make them auto move(and keep relative position with the options frame?
:SetPoint("TOPLEFT", GameMenuFrame, "TOPRIGHT", offX, offY)

and that should keep it attached to the game menu frame
__________________
Chat Consolidate is the solution to any out of control trade chat. Ignore lines, throttle chat, consolidate posts!Follow the link to find out how!

▲ ▲ WoWInterface wont let me triforce >.>
  Reply With Quote
11-27-10, 03:12 PM   #3
Xinhuan
A Chromatic Dragonspawn
 
Xinhuan's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 174
It will help you think of it stuff this way:

Strata > Framelevel > Layer > textureSubLevel

Each of the above is completely inside the item just before it. So WoW renders all frames strata by strata (frames must belong to a strata, default MEDIUM). Within a strata, frames are rendered based on Framelevel (higher number on top).

Frames can have textures and fontstrings (all textures and fontstrings must belong to a frame - the frame that created it), the order these are rendered is based on their Layer (every texture and fontstring must have a Layer). Within the same layer, fontstrings are always rendered on top of textures. The order of textures within the same layer is determined by their textureSubLevel (this is new in patch 4.0, and must be an integer between -8 to 7).

In the past, I have shown that if you have 500 frames (in the same strata) and ordered them from framelevel 1 to 500, it renders far faster than if you ordered the same 500 frames from framelevel 1 to 100000 (with holes in the integers obviously). So try to make the framelevel numbers as small as you can with no gaps.
__________________
Author of Postal, Omen3, GemHelper, BankItems, WoWEquip, GatherMate, GatherMate2, Routes and Cartographer_Routes
  Reply With Quote
11-28-10, 07:07 PM   #4
Lyelu
A Cyclonian
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 44
You may also want to make a container frame:
Code:
Container = CreateFrame("Frame", nil, GameMenuFrame)
Then anchor, I mean parent(?), all your other frames to the Container.

Code:
Portrait = CreateFrame("PlayerModel", nil, Container)
Portrait:SetFrameLevel(15)

PortraitBorder = CreateFrame("Frame", nil, Container)
PortraitBorder:SetFrameLevel(16)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » layering frames..


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off