Thread Tools Display Modes
10-21-05, 07:50 AM   #1
Ego
A Deviate Faerie Dragon
 
Ego's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 15
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)?
  Reply With Quote
10-21-05, 08:44 AM   #2
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
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.

Last edited by Gello : 10-21-05 at 08:51 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Graphics Help » frame sizes

Thread Tools
Display Modes

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