WoW:API UIObject SetAlpha: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Updated to say that transparency is propagated as per changes in 2.1.0)
No edit summary
Line 1: Line 1:
{{widgetmethod}}
{{widgetmethod}} __NOTOC__


Sets the alpha (transparency) of the given object.  
Sets the alpha (transparency) of the given object.  
Line 7: Line 7:
== Arguments ==
== Arguments ==


:;Alpha: Number - a floating-point number between 0 and 1. 1 is fully opaque, 0 is transparent.
:;alpha
: Number - a floating-point number between 0 and 1: 1 is fully opaque, 0 is transparent (in fact, invisible).


== Example ==
== Example ==
 
Makes frame <tt>MyFrame</tt> translucent, more visible than not:
  MyFrame:SetAlpha(.75);  
  MyFrame:SetAlpha(.75);  


Makes the frame translucent, more visible than not.
Fade the whole UI so that it becomes barely visible:
UIParent:SetAlpa(0.1);


== Notes ==
== Notes ==


As of patch 2.1.0, transparency propagates down through all child objects. From [[2.1.0_consolidated_changes#Frames]]:
As of [[2.1.0_consolidated_changes#Frames|patch 2.1.0]], transparency propagates down through all child objects.
 
: ''"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."''
 
 
There was also the following new function added:
 
alpha = Frame:GetEffectiveAlpha()


Returns the effective alpha of a frame, which is logically
== See also ==


Frame:GetParent():GetEffectiveAlpha() * Frame:GetAlpha()
* [[API Frame GetEffectiveAlphs|Frame:GetEffectiveAlpha()]]
* [[API UIObject GetAlpha|UIObject:GetAlpha()]]

Revision as of 00:11, 27 September 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 (in fact, invisible).

Example

Makes frame MyFrame translucent, more visible than not:

MyFrame:SetAlpha(.75); 

Fade the whole UI so that it becomes barely visible:

UIParent:SetAlpa(0.1);

Notes

As of patch 2.1.0, transparency propagates down through all child objects.

"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