Links |
---|
Region:SetAlpha defines the opacity of a Region, normally relative to its immediate parent (if any) unless overriden by Region:SetIgnoreParentAlpha.
region:SetAlpha(alpha)
Arguments
- alpha
- Number - A proportion where 0 means fully transparent (invisible) and 1 means fully opaque or as opaque as its parent.
Example
Makes frame MyFrame
translucent, more visible than not:
MyFrame:SetAlpha(.75);
Fade the whole UI so that it becomes barely visible:
UIParent:SetAlpha(0.1);
Notes
- Values less than zero (ie, negative) or greater than one are silently changed to zero or one to prevent an error
Patch changes
Patch 2.1.0 (2007-05-22): A frame's alpha value now also affects all of its descendants.[1]
- "Frame alpha now propagates in the same way as scale (though is clamped between 0 and 1 on each object). This means you can cleanly fade the whole UI or specific frame assemblies."
- "Frame alpha now propagates in the same way as scale (though is clamped between 0 and 1 on each object). This means you can cleanly fade the whole UI or specific frame assemblies."
See also
- Region:GetAlpha - Returns the set opacity, normally relative to the immediate parent (if any)
- Region:GetEffectiveAlpha - Returns the calculated net opacity inclusive of all parents
- Region:SetIgnoreParentAlpha - Changes the behaviour of SetAlpha() when the region has a parent
- Region:Hide() - Removes a region from being drawn at all, preventing interaction, which differs subtly from a region that is interactable but invisible
References
- ^ Cairenn, quoting Iriel 2007-05-15. Upcoming 2.1.0 API Changes - Concise List. WoWInterface.