The API is no longer being updated here until further notice. |
Returns the scale of the region.
scale = Region:GetScale() effectiveScale = Region:GetEffectiveScale()
Returns[]
- scale
- number - The scale of the region.
- effectiveScale
- number - The effective scale after propagating from the parent region. This is equal to
f:GetScale() * f:GetParent():GetScale()
Example[]
Scale propagates from a region to its children, unless disabled with SetIgnoreParentScale.
local parent = CreateFrame("Frame")
parent:SetScale(0.5)
local f = CreateFrame("Frame", nil, parent)
f:SetScale(0.5)
print(f:GetScale()) -- 0.5
print(f:GetEffectiveScale()) -- 0.25
f:SetIgnoreParentScale(true)
print(f:GetEffectiveScale()) -- 0.5
Patch changes[]
Patch 8.0.1 (2018-07-17): Texture, FontString and Line can now be scaled directly using the newly added SetScale
, GetScale
and GetEffectiveScale
functions[1]
References[]
- ^ Aerythlea 2018-11-14. Battle for Azeroth Addon Changes.