Difference between revisions of "Category:LSL Alpha"

From Second Life Wiki
Jump to navigation Jump to search
m
(Added examples pertaining to setting Alpha, as well as descriptions on how it relates to the build tool.)
Line 1: Line 1:
{{LSL Header|ml=*}}
{{LSL Header|ml=*}}
The term "Alpha" refers to how opaque or transparent an object (or, in this case, a prim) is. In Second Life, the alpha property is set by the scripting functions [[llSetAlpha]], [[llSetLinkAlpha]], [[llSetPrimitiveParams]], and [[llSetLinkPrimitiveParams]]. These functions use a [[float]] value. When set to '''0.0''', the object/prim is fully invisible. When set to '''1.0''', the object is non-transparent.
Sometimes, [[Resident]]s refer to a transparent [[texture]] as ''alpha texture''. This is not to be confused with this prim property. See [[llSetTexture]] and [[TEXTURE_TRANSPARENT]] instead.


The term "Alpha" refers to how opaque or transparent an object (or, in this case, a prim) is. In Second Life, the alpha property is set by the scripting command [[llSetAlpha]]. This command uses a [[float]] value. When set to '''0.0''', the object/prim is fully invisible. When set to '''1.0''', the object is fully opaque.
==Build Mode==
 
In Build Mode, the alpha is represented by a percentage, ranging from '''0%''' to '''90%'''.  
In Build Mode, the alpha is represented by a percentage, ranging from 0% to 100%. 0% is like typing in ''llSetAlpha(1.0)'' in a script, and 100% is like typing ''llSetAlpha(0.0)''. There is a cap of 90%, but by using the [[llSetAlpha]] command, you can get around this.
('''Note''': The '''90%''' cap is for viewers that have been officially released by Linden Labs)
 
==Examples==
Sometimes, [[Resident]]s refer to a transparent [[texture]] as ''alpha texture''. This is not to be confused with this prim property. See [[llSetTexture]] and [[TEXTURE_TRANSPARENT]] instead.
Below are examples on how one may set the alpha of an object.  
{|cellspacing="0" cellpadding="6" border="1" style="border: 1px solid #aaaaaa; margin: 1em 1em 1em 0pt; background-color: #F8F8FF; border-collapse: collapse"
!style="background-color: #D2D3FF" | Function
!style="background-color: #D2D3FF" | LSL Example
!style="background-color: #D2D3FF" | Description
|-
| [[llSetAlpha]]
| <lsl>llSetAlpha(1.0, ALL_SIDES);</lsl>
| This will set the object's sides' alpha to non-transparent ; '''0%''' using the build tool.
|-
| [[llSetLinkAlpha]]
| <lsl>llSetLinkAlpha(LINK_SET, 0.0, ALL_SIDES);</lsl>
| This will set link-set's alpha to fully transparent, or '''100%''' using the build tool. ('''Note''': The Viewers released by Linden Labs are unable to set the alpha of an object to fully transparent without a script; the limit is caped at '''90%''')
|-
| [[llSetPrimitiveParams]]
| <lsl>llSetPrimitiveParams([PRIM_COLOR, ALL_SIDES, llGetColor(ALL_SIDES), 0.5]);</lsl>
| This will set the object's alpha to opaque; '''50%''' using the build tool.
|-
| [[llSetLinkPrimitiveParams]]
| <lsl>llSetLinkPrimitiveParams(LINK_SET, [PRIM_COLOR, ALL_SIDES, llGetColor(ALL_SIDES), 0.5]);</lsl>
| This will set the link-set's alpha to opaque; '''50%''' using the build tool.
|-
|}


{{LSLC|}}{{LSLC|Face|*Alpha}}
{{LSLC|}}{{LSLC|Face|*Alpha}}

Revision as of 15:31, 25 July 2010

The term "Alpha" refers to how opaque or transparent an object (or, in this case, a prim) is. In Second Life, the alpha property is set by the scripting functions llSetAlpha, llSetLinkAlpha, llSetPrimitiveParams, and llSetLinkPrimitiveParams. These functions use a float value. When set to 0.0, the object/prim is fully invisible. When set to 1.0, the object is non-transparent. Sometimes, Residents refer to a transparent texture as alpha texture. This is not to be confused with this prim property. See llSetTexture and TEXTURE_TRANSPARENT instead.

Build Mode

In Build Mode, the alpha is represented by a percentage, ranging from 0% to 90%. (Note: The 90% cap is for viewers that have been officially released by Linden Labs)

Examples

Below are examples on how one may set the alpha of an object.

Function LSL Example Description
llSetAlpha <lsl>llSetAlpha(1.0, ALL_SIDES);</lsl> This will set the object's sides' alpha to non-transparent ; 0% using the build tool.
llSetLinkAlpha <lsl>llSetLinkAlpha(LINK_SET, 0.0, ALL_SIDES);</lsl> This will set link-set's alpha to fully transparent, or 100% using the build tool. (Note: The Viewers released by Linden Labs are unable to set the alpha of an object to fully transparent without a script; the limit is caped at 90%)
llSetPrimitiveParams <lsl>llSetPrimitiveParams([PRIM_COLOR, ALL_SIDES, llGetColor(ALL_SIDES), 0.5]);</lsl> This will set the object's alpha to opaque; 50% using the build tool.
llSetLinkPrimitiveParams <lsl>llSetLinkPrimitiveParams(LINK_SET, [PRIM_COLOR, ALL_SIDES, llGetColor(ALL_SIDES), 0.5]);</lsl> This will set the link-set's alpha to opaque; 50% using the build tool.