WoWInterface (
-   Graphics Help (
-   -   frame sizes (

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

in xml:

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

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 11:06 PM.

vBulletin © 2018, Jelsoft Enterprises Ltd
© 2004 - 2017 MMOUI