llSetColor/ru

From Second Life Wiki
< LlSetColor
Revision as of 08:20, 20 August 2012 by Highstaker Resident (talk | contribs) (Created page with "{{LSL_Function |inject-2={{LSL Function/color|color}}{{LSL_Function/face|face|}} |func_id=49|func_sleep=0.0|func_energy=10.0 |func=llSetColor |p1_type=vector|p1_name=color|p2_typ…")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Summary

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

Sets the color on face of the prim.

• 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.

Caveats

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

Examples

<lsl> integer face = -1; vector color = <1.0, 1.0, 1.0>;

default {

   touch_start(integer num)
   {
       if(~face)//quick & dirty check for -1
           llSetColor(color, face); //restore the color
       face = (face + 1) % llGetNumberOfSides(); //increment and keep the face number in range
       color = llGetColor(face); //save the face's color
       llSetColor(<0.5, 0.0, 0.0>, face );//change the face's color
   }

}

</lsl>

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 );