Unofficial LSL Reference

[[functions:llsetlinkalpha]]


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

Function: llSetLinkAlpha

llSetLinkAlpha(integer link, float alpha, integer face)

Parameters

An integer value defining the link number of the prim to be read.

The following special link specification constants can be used:-

ConstantValueDescription
LINK_THIS -4 refers to the prim the script is in
LINK_ROOT 1 refers to the root prim in a multi-prim linked set
LINK_SET -1 refers to all prims
LINK_ALL_OTHERS -2 refers to all prims other than the one the script is in
LINK_ALL_CHILDREN -3 refers to all children (everything but the root)

alpha

A float value between 0.0 and 1.0 indicating the degree of opacity, with 1.0 being fully opaque.

face

An integer value defining the face of the prim to be affected. ALL_SIDES affects all faces.

Notes

  • 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.
  • The function silently fails if face indicates a face that does not exist, or if link indicates a non-existent prim.

Short examples

llSetLinkAlpha(3, 0.5, 6); // Will set face 6 of link 3 to 50% transparent
llSetLinkAlpha(2, 0.0, ALL_SIDES);  // Will make link 3 or this object disappear

Complete examples

llSetLinkAlpha-example.lsl
// This will cause all other prims of the current object to blink on and
// off continuously (appear and disappear)
integer  flip;
default
{
    state_entry()
    {
        llSetTimerEvent(0.5);
    }
    timer()
    {
        flip = !flip;
        llSetLinkAlpha(LINK_ALL_OTHERS, flip, ALL_SIDES);
    }
}

See also