The API is no longer being updated here until further notice. |
Returns the size of the region.
width, height = ScriptRegion:GetSize ([ignoreRect]) width = ScriptRegion:GetWidth ([ignoreRect]) height = ScriptRegion:GetHeight([ignoreRect])
Arguments[]
- ignoreRect
- boolean?
= false
- If true, will only return the explicit size of this region and ignores any implicit size inferred from anchor points or contents.
Returns[]
- width
- number - The width of the region.
- height
- number - The height of the region.
Example[]
The returned value is not affected by scale.
local f = CreateFrame("Frame", nil, nil, "BackdropTemplate")
f:SetPoint("CENTER")
f:SetSize(100, 100)
f:SetBackdrop(BACKDROP_TUTORIAL_16_16)
print(f:GetSize()) -- 100, 100
f:SetScale(1.5) -- visibly increases scale but `size` is unaffected
print(f:GetSize()) -- 100, 100
If explicitSize
is true and no explicit size has been set, then it will return a zero width and height.
local f = CreateFrame("Frame", nil, UIParent)
f:SetAllPoints()
print(f:GetSize(false)) -- 2133.3334960938, 1200
print(f:GetSize(true)) -- 0, 0