WoW:API UIObject SetAlpha: Difference between revisions
Jump to navigation
Jump to search
(Parent/child alpha relationship is not multiplicative) |
(Updated to say that transparency is propagated as per changes in 2.1.0) |
||
| Line 17: | Line 17: | ||
== Notes == | == Notes == | ||
As of patch 2.1.0, transparency propagates down through all child objects. From [[2.1.0_consolidated_changes#Frames]]: | |||
''"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."'' | |||
There was also the following new function added: | |||
alpha = Frame:GetEffectiveAlpha() | |||
Returns the effective alpha of a frame, which is logically | |||
Frame:GetParent():GetEffectiveAlpha() * Frame:GetAlpha() | |||
Revision as of 17:55, 17 June 2007
← Widget API ← UIObject < SetAlpha
Sets the alpha (transparency) of the given object.
MyObject:SetAlpha(alpha)
Arguments
- Alpha
- Number - a floating-point number between 0 and 1. 1 is fully opaque, 0 is transparent.
Example
MyFrame:SetAlpha(.75);
Makes the frame translucent, more visible than not.
Notes
As of patch 2.1.0, transparency propagates down through all child objects. From 2.1.0_consolidated_changes#Frames:
"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."
There was also the following new function added:
alpha = Frame:GetEffectiveAlpha()
Returns the effective alpha of a frame, which is logically
Frame:GetParent():GetEffectiveAlpha() * Frame:GetAlpha()