Thread: Resize frame
View Single Post
01-25-14, 10:01 AM   #13
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Originally Posted by Resike View Post
Ninjaed this from Peggle:

https://github.com/Resike/Resize
From the Peggle addon? Is't it obfuscated?
Does it work if the overall UI scale is not set to default? (interface settings > UI scale)

Regarding the anchor point:
You can't just change bottomleft to topleft. The anchor point changes everything.
Lets assume UIParent has a size of 100x100. As you know in wow 0/0 is the lower left corner and 1/1 is the top right corner. Always. Regardless of where something is anchored or if we are talking about frames, cursor coordinates, textures or whatever.
Setpoint coordinates are relative to the anchor point.
A positive x means a shift to the right. Negative x is left.
Positive y shifts to the top (remember, in wow 0/0 is the bottom left corner and 0/1 is top left) and negative y shifts to the bottom.
Now let's see what happens:

setpoint("bottomleft", parent, "bottomleft", 20, 20) is something like:

Code:
0/100                100/100





        x


0/0                100/0
And setpoint("topleft", parent, "topleft", 100, 100) would be something like:


Code:
         x


0/100                100/100





  


0/0                100/0

Last edited by Duugu : 01-25-14 at 10:07 AM.
  Reply With Quote