Unofficial LSL Reference

[[functions:llsetalpha]]


Unofficial LSL reference

User Tools

Login

You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.

Login

Forgotten your password? Get a new one: Set new password

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

functions:llsetalpha [2014-01-03 14:18 SLT]
omei created
functions:llsetalpha [2015-02-04 17:57 SLT] (current)
sei See Also: +llSet[Link]Texture
Line 1: Line 1:
 +$nav
 ===== Function: llSetAlpha ===== ===== Function: llSetAlpha =====
  
 <code lsl2> <code lsl2>
-null llSetAlpha(float alpha, integer face)+llSetAlpha(float alpha, integer face)
 </​code>​ </​code>​
 +Sets the opacity (also called alpha) of a face or all faces of the current prim.
  
 ===== Parameters ===== ===== Parameters =====
Line 11: Line 13:
  
 === face === === face ===
-An integer value defining the face of the prim to be affected. ALL_SIDES affects all faces. +$faceparam
- +
-===== Result ===== +
- +
-No result is returned+
  
 ===== Notes ===== ===== Notes =====
  
-  This function ONLY affects the prim the script is in. To change the alpha on another prim, use llSetLinkAlpha.+  ​This function ONLY affects the prim the script is in. To change the alpha on another prim, use $lfn[llSetLinkAlpha]. 
 +  * Note that the viewer shows transparency,​ not opacity, and it shows it in percentage. To convert from viewer transparency to an alpha value suitable for use with this function, use this formula: //​alpha//​=(100-//​transparency//​)/​100. For example, a transparency of 35% is an alpha value of 0.65.
  
 ===== Short examples ===== ===== Short examples =====
Line 34: Line 33:
     state_entry()     state_entry()
     {     {
-        llSetAlpha(0.0, ​1);  // Will make face of this prim go transparent+        llSetAlpha(0.0, ​2);  // Will make face of this prim go transparent
     }     }
 } }
Line 41: Line 40:
 ===== See also ===== ===== See also =====
  
-  * [[llSetLinkAlpha]]+  * $lfn[llSetLinkAlpha] ​ to change the opacity on any chosen prim in the current object. 
 +  * $lfn[llSetColor] to set the color of a face in the current prim, or $lfn[llSetLinkColor] to set it for any chosen prim. 
 +  * The $lfn[PrimitiveParams/​|PrimitiveParams] family of functions, with $lct[PRIM_COLOR],​ allows changing color and alpha at the same time. 
 +  * $lfn[llSetTexture] and $lfn[llSetLinkTexture] can also be used to change the texture to $lct[TEXTURE_TRANSPARENT].