Links |
---|
Defines the parent object of a Region from which many properties are inherited (scale, visibility, etc.).
region:SetParent(parent) region:SetParent("parent")
Argument
- parent
-
- UIObject - Direct table reference to the new parent
- String - Name of the global reference to the new parent, as in _G["parent"]
Example
local myFrame = CreateFrame("Frame") print(myFrame:GetEffectiveScale()) -- 1 myFrame:SetParent(UIParent) print(myFrame:GetEffectiveScale()) -- 0.89372 (it is now inheriting UIParent's scale)
Notes
- An error will result if parent or _G["parent"] do not exist or are not UIObjects
- Children inherit visibility and effective scale from their parents unless this inheritence is explicitly stopped via Region:SetIgnoreParentAlpha and Region:SetIgnoreParentScale
- Frames normally occupy the same Frame Strata as their parent, with a Frame Level of plus one (but this can be overriden)
- LayeredRegions are drawn overtop their parent frames, respecting Layers
Patch changes
Patch 1.11.0 (2006-06-19): Consolidated to
Region:SetParent()
[1]Patch 1.10.0 (2006-03-28): Added as
Texture:SetParent()
andFontString:SetParent()
[2]- Previously existed as
Frame:SetParent()
- Previously existed as
See also
- Frame:GetChildren() - Returns the children of a frame
- AnimationGroup:GetAnimations() - Returns the children of an animation group
References
- ^
slouken 2006-05-12. Re: Upcoming 1.11 Changes - Concise List. Archived from the original on 2006-05-12.
- ^
slouken 2005-12-28. Re: Upcoming 1.10 Changes - Concise List. Archived from the original on 2005-12-28.