Difference between revisions of "LlSetColor"

From Second Life Wiki
Jump to navigation Jump to search
(EX)
Line 10: Line 10:
|caveats
|caveats
|constants
|constants
|examples
|examples=<pre>
integer SIDE  = 0;   
 
default
{   
    state_entry()
    {
        llSetColor(<1,0,0>, SIDE);   
    }
   
    touch_start(integer num)
    {
        if(SIDE > 5) llResetScript();   
 
        llSetColor(<1,0,0>, SIDE);
       
        SIDE++;
    }
}
</pre>
|helpers
|helpers
|also_functions=
|also_functions=

Revision as of 16:07, 17 May 2007

Summary

Function: llSetColor( vector color, integer face );
0.0 Forced Delay
10.0 Energy

Sets the color on face

• vector color color in RGB <R, G, B> (<0.0, 0.0, 0.0> = black, <1.0, 1.0, 1.0> = white)
• integer face face number or ALL_SIDES

If face is ALL_SIDES then the function works on all sides.

Newbie Notes

llSetColor changes the color of a prim, either on a specific side (face) or the entire prim.

Example:
llSetColor(<r, g, b>, ALL_SIDES);

r, g, b: values for red, green, blue ranging from <0.0, 0.0, 0.0> (black) to <1.0, 1.0, 1.0> (white)

To continue reading see: Newbie Notes

Caveats

  • The function silently fails if its face value indicates a face that does not exist.

Examples

integer SIDE  = 0;    

default
{    
    state_entry()
    {
        llSetColor(<1,0,0>, SIDE);    
    }
    
    touch_start(integer num)
    {
        if(SIDE > 5) llResetScript();    

        llSetColor(<1,0,0>, SIDE);
        
        SIDE++;
    }
}

See Also

Events

•  changed CHANGED_COLOR

Functions

•  llGetAlpha Gets the prim's alpha
•  llSetAlpha Sets the prim's alpha
•  llGetColor Gets the prim's color
•  llSetLinkColor Sets link's color
•  llSetLinkAlpha Sets link's alpha

Articles

•  Color in LSL

Deep Notes

Signature

function void llSetColor( vector color, integer face );