4 /* define 3 global vars to hold the rotation values */
12 description { state: "default" 0.0;
13 color: 255 255 255 255;
18 description { state: "default" 0.0;
21 text: "Click labels to rotate";
30 description { state: "default" 0.0;
42 description { state: "default" 0.0;
54 description { state: "default" 0.0;
67 description { state: "default" 0.0;
82 signal: "mouse,down,1";
85 /* define local vars */
89 /* get global var (and increment) */
90 x = get_int(rotx) + 10;
92 set_int(rotx, round(x));
93 /* crete a new custom state (inherit from default 0.0) */
94 custom_state(PART:"rect", "default", 0.0);
95 /* change the rotation in the custom state */
96 set_state_val(PART:"rect", STATE_MAP_ROT_X, x);
97 /* apply the custom state */
98 set_state(PART:"rect", "custom", 0.0);
99 /* update the label to show the current value */
100 snprintf(buf, sizeof(buf), "Rot X (%d)", round(x));
101 set_text(PART:"X", buf);
105 signal: "mouse,down,1";
109 new Float:y = get_int(roty) + 10;
110 set_int(roty, round(y));
111 custom_state(PART:"rect", "default", 0.0);
112 set_state_val(PART:"rect", STATE_MAP_ROT_Y, y);
113 set_state(PART:"rect", "custom", 0.0);
114 snprintf(buf, sizeof(buf), "Rot Y (%d)", round(y));
115 set_text(PART:"Y", buf);
119 signal: "mouse,down,1";
123 new Float:z = get_int(rotz) + 10;
124 set_int(rotz, round(z));
125 custom_state(PART:"rect", "default", 0.0);
126 set_state_val(PART:"rect", STATE_MAP_ROT_Z, z);
127 set_state(PART:"rect", "custom", 0.0);
128 snprintf(buf, sizeof(buf), "Rot Z (%d)", round(z));
129 set_text(PART:"Z", buf);