ScriptRegion:SetParent

From Warcraft Wiki
Jump to navigation Jump to search

Sets the parent of the region.

ScriptRegion:SetParent([parent])

Arguments

parent
Frame?🔗 - Reference to the parent widget. Unsets the parent if omitted.

Details

Example

Sets the parent of a frame, the effective scale will be 0.64 * 0.5 = 0.32

local f = CreateFrame("Frame")
f:SetScale(0.5)
f:SetParent(UIParent)

print(UIParent:GetScale()) -- 0.63999998569489
print(f:GetScale(), f:GetEffectiveScale()) -- 0.5, 0.31999999284744

Patch changes

Dragonflight Patch 10.0.0 (2022-10-25): No longer supports accepting a string argument, e.g. "UIParent" instead of UIParent. No longer requires an explicit nil to remove the parent.