Region:GetScale

From Warcraft Wiki
(Redirected from API Frame GetEffectiveScale)
Jump to navigation Jump to search
GitHub Octocat.png  Dragonflight-Icon-Inline.png  BTNTemp.png  Wowprogramming.png Region:GetScale
GitHub Octocat.png  Dragonflight-Icon-Inline.png  BTNTemp.png  Wowprogramming.png Region:GetEffectiveScale
GitHub Octocat.png  Dragonflight-Icon-Inline.png  BTNTemp.png  Wowprogramming.png Region:SetScale
GitHub Octocat.png  Dragonflight-Icon-Inline.png  BTNTemp.png Region:SetIgnoreParentScale
GitHub Octocat.png  Dragonflight-Icon-Inline.png  BTNTemp.png Region:IsIgnoringParentScale

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

Battle for Azeroth 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

 
  1. ^ Blizzard Entertainment Aerythlea 2018-11-14. Battle for Azeroth Addon Changes.