WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Help : Setpoint in frame (https://www.wowinterface.com/forums/showthread.php?t=58037)

Simba 06-05-20 09:35 AM

Help : Setpoint in frame
 
Hello,

I made a simple addon that shows some stats like crit and attack power on a transparent frame.

I'm making a settings window to select which stats to show. Where I'm having issues is to have the stats to show in order, without leaving gaps in between.

For example, my current stats are shown in this order :

AP
Crit
Hit

If I uncheck the Crit box, I have a gap between AP and Hit. How can I make it so that Hit fills the empty space ?

Thanks!

Fizzlemizz 06-05-20 10:46 AM

You need to reset the points after the box is checked/unchecked.

Something like:

Code:

CritFrame:Hide()
HitFrame:ClearAllPoints()
HitFrame:SetPoint("TOPLEFT", APFrame, "BOTTOMLEFT")

or
Code:

CritFrame:Show()
HitFrame:ClearAllPoints()
HitFrame:SetPoint("TOPLEFT", CritFrame, "BOTTOMLEFT")

Or you could just set the text of the fontstrings from top to bottom and set the last one(s) blank so you don't have to move anything.


All times are GMT -6. The time now is 09:21 AM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI