Sets an anchor point for the region
Signature:
Region:SetPoint("point"
[,
relativeTo
[,
"relativePoint"
[,
xOffset
[,
yOffset]]]])
Arguments:
point
- Point on this region at which it is to be anchored to another (string
, anchorPoint)relativeTo
- Reference to the other region to which this region is to be anchored; if omitted, anchors the region relative to its parent (or to the screen dimensions if the region has no parent). If passed explicitelynil
, defaults to the entire screen. (region
)relativePoint
- Point on the other region to which this region is to be anchored; ifnil
or omitted, defaults to the same value aspoint
(string
, anchorPoint)xOffset
- Horizontal distance betweenpoint
andrelativePoint
(in pixels; positive values putpoint
to the right ofrelativePoint
); ifnil
or omitted, defaults to0
(number
)yOffset
- Vertical distance betweenpoint
andrelativePoint
(in pixels; positive values putpoint
belowrelativePoint
); ifnil
or omitted, defaults to0
(number
)
Examples:
-- Create a sample frame and give it a visible background color local frame = CreateFrame("Frame", "TestFrame", UIParent) local background = frame:CreateTexture("TestFrameBackground", "BACKGROUND") background:SetTexture(1, 1, 1, 0.25) background:SetAllPoints() -- Set the top left corner 5px to the right and 15px above UIParent's top left corner frame:SetPoint("TOPLEFT", 5, 15) -- Set the bottom edge to be 10px below WorldFrame's center frame:SetPoint("BOTTOM", WorldFrame, "CENTER", 0, -10) -- Set the right edge to be 20px to the left of WorldFrame's right edge frame:SetPoint("RIGHT", WorldFrame, -20, 0)