WoW:API UIObject SetAlpha: Difference between revisions

Updated to say that transparency is propagated as per changes in 2.1.0
(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 ==


Transparency is '''not''' applied to child objects the same as scaling. The parent frame's alpha is inherited if and only if the child's alpha has not been set or has been set to 1. If the child frame's alpha has been set to anything other than 1, then that alpha value is absolute and is unaffected by the parent frame's alpha setting, meaning a parent frame can be "dimmer" than its child frames.
As of patch 2.1.0, transparency propagates down through all child objects. From [[2.1.0_consolidated_changes#Frames]]:


''Note'': it may have behaved multiplicatively like SetScale() in previous patches, and the current behavior (patch 2.06) may be a bug. This is unconfirmed.


If you attempt to set the same value more than once it will detect this and return early after the first attempt.
''"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()
Anonymous user