Thread Tools Display Modes
09-12-19, 02:55 AM   #1
glupikreten
A Theradrim Guardian
Join Date: Apr 2009
Posts: 60
Lua reposition frames

Hi,

Can someone explain to me why this does not work:

BNToastFrame:HookScript("OnShow", function(self)
BNToastFrame:ClearAllPoints()
BNToastFrame:SetPoint("BOTTOMLEFT", someframe, "TOPLEFT", 0, 15)
end)

While this works like a charm...

LootFrame:HookScript("OnShow", function(self)
LootFrame:ClearAllPoints()
LootFrame:SetPoint("BOTTOMLEFT", someframe, "TOPLEFT", 450, 250)
end)


Please?


And also is it possible to change strata of FPS frames...

FramerateLabel:SetFrameStrata("HIGH")
FramerateText:SetFrameStrata("HIGH")

not working... afaik strata for both is WORLD which is below BACKGROUND

Last edited by glupikreten : 09-12-19 at 02:57 AM.
  Reply With Quote
09-12-19, 05:08 AM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
Originally Posted by glupikreten View Post
Can someone explain to me why this does not work:

Code:
BNToastFrame:HookScript("OnShow", function(self)
	BNToastFrame:ClearAllPoints()
	BNToastFrame:SetPoint("BOTTOMLEFT", someframe, "TOPLEFT", 0, 15)
end)
The ToastFrame position may be set after OnShow is fired. You can nuke these functions by setting an empty function in their place.
Code:
BNToastFrame:ClearAllPoints()
BNToastFrame:SetPoint("BOTTOMLEFT", someframe, "TOPLEFT", 0, 15)

local function NoOp() end--	Do nothing
BNToastFrame.ClearAllPoints=NoOp;
BNToastFrame.SetPoint=NoOp;



Originally Posted by glupikreten View Post
And also is it possible to change strata of FPS frames...

Code:
FramerateLabel:SetFrameStrata("HIGH")
FramerateText:SetFrameStrata("HIGH")
not working... afaik strata for both is WORLD which is below BACKGROUND
These are regions, not frames. You have to make a new frame and re-set their parent to it. You may also want to remove FramerateLabel from the UIPARENT_MANAGED_FRAME_POSITIONS table or strange things will happen with its anchors.
Code:
UIPARENT_MANAGED_FRAME_POSITIONS.FramerateLabel=nil;
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
09-12-19, 10:22 AM   #3
glupikreten
A Theradrim Guardian
Join Date: Apr 2009
Posts: 60
Thank you ... this helped
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Lua reposition frames

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