Originally Posted by Miralen
I have two panels one on the right and one on the left and I want them to be positioned let's say 10% away from the side of the screen and bottom of the screen.
|
So I want to get this right, you want
x and
y pos to be a percentage of the width and height of your screen? You could use this function as your panel's OnLoad handler:
Code:
OnLoad = function(self)
local width, height = UIParent:GetWidth(), UIParent:GetHeight()
-- percentage; set percentX to negative if panel is
-- anchored to RIGHT side, percentY if anchored to TOP
local percentX, percentY = 0.10, 0.10
local points = {self:GetPoint()}
points[4], points[5] = width * percentX, height * percentY
self:ClearAllPoints()
self:SetPoint(unpack(points))
end