WoW:API UIObject SetAlpha: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
(Reformat, expand.)
Line 1: Line 1:
{{widgetmethod}}
{{widgetmethod}}


Sets the alpha of given object. Alpha is an integer between 0 and 1.  1 being opaque, 0 being transparent.
Sets the alpha (transparency) of the given object.  


Note: If you attempt to set the same value to this more than once it will detect this and will return early after the first attempt.
MyObject:SetAlpha(alpha)


e.g. MyFrame:SetAlpha(.75); makes the frame translucent, more visible than not.
== 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 ==
 
Transparency is applied to child objects the same as scaling. If a parent is set to e.g 0.5, and a child is set to 1, the child will still be shown as 0.5. If a parent and child both are set to 0.5, the result will be 0.5 * 0.5 = 0.25 for the child.
 
If you attempt to set the same value more than once it will detect this and return early after the first attempt.

Revision as of 07:54, 29 July 2006

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

Transparency is applied to child objects the same as scaling. If a parent is set to e.g 0.5, and a child is set to 1, the child will still be shown as 0.5. If a parent and child both are set to 0.5, the result will be 0.5 * 0.5 = 0.25 for the child.

If you attempt to set the same value more than once it will detect this and return early after the first attempt.