zzzz

Join us in Phaze Demesnes or follow us:

Home   Show All
Category: Contributor: Creator
Color Color_and_TextONclick_Script  

Color_and_TextONclick_Script

Color and TextONclick Script.lsl

Category: Color
By : Anonymous
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life + OpenSim

the Zip file

Download all files for Color_and_TextONclick_Script
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Color_and_TextONclick_Script_1.lsl
1
2 // Cycle through colours and set prim colour and light property to match
3
4 float red = 1;
5 float green = 1;
6 float blue = 1;
7
8 vector currentColour = <1,1,1>;
9
10 float COLOUR_INCREMENT = 0.20;
11
12 float TIMER_INT = 0.5;
13
14
15 changeColour()
16 {
17 if (red == 1.0)
18 {
19 if (blue > 0)
20 {
21 blue -= COLOUR_INCREMENT;
22 }
23 else if (green < 1.0)
24 {
25 green += COLOUR_INCREMENT;
26 }
27 }
28 if (green == 1.0)
29 {
30 if (red > 0)
31 {
32 red -= COLOUR_INCREMENT;
33 }
34 else if (blue < 1.0)
35 {
36 blue += COLOUR_INCREMENT;
37 }
38 }
39 if (blue == 1.0)
40 {
41 if (green > 0)
42 {
43 green -= COLOUR_INCREMENT;
44 }
45 else if (red < 1.0)
46 {
47 red += COLOUR_INCREMENT;
48 }
49 }
50 currentColour = <red, green, blue>;
51 llSetColor(currentColour, ALL_SIDES);
52 llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, currentColour, 1, 10, 2]);
53
54 }
55
56
57 default
58 {
60 {
61 llSetTimerEvent(TIMER_INT);
63 }
64
65 touch_start(integer total_number)
66 {
67 llSay(0, "It all starts with a cube.");
68 }
69
70 timer()
71 {
72 changeColour();
73 }
74 }
75 // END //