WoWInterface

WoWInterface (http://www.wowinterface.com/forums/index.php)
-   Graphics Help (http://www.wowinterface.com/forums/forumdisplay.php?f=14)
-   -   frame sizes (http://www.wowinterface.com/forums/showthread.php?t=2144)

Ego 10-21-05 07:50 AM

frame sizes
 
I have a frame in a mod I'm working on. It's set to parent="UIParent"
and has the size set to relative with x="1" and y="1". When I query
GetWidth() and GetHeight() on my frame, it returns 1280 plus a small
fraction for both. Doing the same for UIParent I get the expected
1024 x 768 which is what my current resolution is set to.

Is there a simple way to make sure my frame matches the size and position
of it's parent (in this case UIParent, or possibly WorldFrame)?

Gello 10-21-05 08:44 AM

You can set anchors instead of width/height.

In lua:

frame:ClearAllPoints() -- removes all anchors
frame:SetPoint("TOPLEFT","UIParent","TOPLEFT")
frame:SetPoint("BOTTOMRIGHT","UIParent","BOTTOMRIGHT")

in xml:

<Anchors>
<Anchor point="TOPLEFT" relativeTo="UIParent" relativePoint="TOPLEFT"/>
<Anchor point="BOTTOMRIGHT" relativeTo="UIParent" relativePoint="BOTTOMRIGHT"/>
</Anchors>

This will stretch the frame to cover the whole screen even if it resizes. I commonly use this to stretch a background texture in a frame. Once anchored to both corners there's no need to go back to it if I change the size of the window.


All times are GMT -6. The time now is 10:53 PM.

vBulletin © 2014, Jelsoft Enterprises Ltd
©2012 ZAM Network LLC