The API is no longer being updated here until further notice. |
Returns the number of anchor points for the region.
numPoints = ScriptRegionResizing:GetNumPoints()
Returns[]
- numPoints
- number - The number of anchor points for the region. Returns
0
if there are no points.
Example[]
Prints the anchor points of UIParent.
for i = 1, UIParent:GetNumPoints() do
print(i, UIParent:GetPoint(i))
end
-- 1, "TOPLEFT", nil, "TOPLEFT", 0, 0
-- 2, "BOTTOMRIGHT", nil, "BOTTOMRIGHT", 0, 0
A region only requires one or two points to be drawn, but you can set all nine points if desired.
local f = CreateFrame("Frame", nil, UIParent)
local points = {
"TOPLEFT", "TOPRIGHT", "BOTTOMLEFT", "BOTTOMRIGHT",
"TOP", "BOTTOM", "LEFT", "RIGHT", "CENTER"
}
print(f:GetNumPoints()) -- 0
for _, v in pairs(points) do
f:SetPoint(v)
end
print(f:GetNumPoints()) -- 9
Patch changes[]
Patch 1.10.0 (2006-03-28): Added.