-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcontrols.pde
353 lines (293 loc) · 7.3 KB
/
controls.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
/*
CONTROLES
t,g : Para aumentar y disminuir el tamaño del dibujo
y,h : Para aumentar y disminuir la circunferencia de giro
u,j : Para aumentar el efecto espirografico.
A : Para limpiar la pantalla
D : Para activar el modo que se limpia la pantalla constantemente
Q : Para randomizar de 0 el tamaño al ultimo tamaño asignado.
E : Para activar el color manual de colores
modo HSB
I,K Para aumentar y disminuir el HUE
O,L Para aumentar y disminuir la saturacion
P,Ñ Para aumentar y disminuir el brillo.
B,N : transparencia.
R : Para resetear los valores del dibujo al minimo
1: Colores del borde
2,3: Tamaño del borde
4,5: Saturación del borde
6,7: brillo del borde
8,9: transparencia del borde
V : MODO DISPLAY
1) DIBUJO SOLO. En este modo es solo un patron de dibujos. sin que se mueva.
M: Modo mouse o no mouse. Dibuja solo cuando apretas el mouse o dibuja siempre.
2) MODO OBJETOS . Con cada click genera un objeto que se va moviendo.
C: Te desactiva el ultimo objeto que apretaste. Lo inhabilita(el dibujo queda hecho);
3) MODO OBJETOS SETIABLES.
Se pueden crear grupos de objetos seteados con variables para luego poder crear otros y tener distintos grupos.
para hacer varias figuras moviendose.
BARRA ESPACIADORA : Setea un grupo de objetos para que no cambien las variables
(Todos los que se crearon desde que se apreto el mouse hasta que se apreto la barra espaciadora).
B : PRINT SCREEN
*/
void mousePressed() {
if (displaymode==3) {
display3[cont].setPos(mouseX, mouseY);
Ccontgroup[Ccont+1] = cont;
for (int i=0; i<=Ccont; i++) {
println("CCcont", i);
println("Ccontgroup[Ccont] = ", Ccontgroup[i]);
}
cont++;
if (cont == display3.length) {
cont = 0;
}
}
}
void keyPressed() {
if (key == CODED) {
if (keyCode == LEFT) {
if (displaymode == 2) {
xcant++;
}
speedX++;
}
if (keyCode == RIGHT) {
if (displaymode == 2 && xcant > 0 ) {
xcant--;
}
if (speedX > 0){
speedX--;
}
}
if (keyCode == UP) {
speedY++;
if (displaymode == 2) {
ycant++;
}
Cantobj++;
println("Cantobj", Cantobj);
}
if (keyCode == DOWN){
Cantobj--;
}
if (keyCode == DOWN ) {
if (speedY > 0){
speedY--;
}
if (displaymode == 2 && ycant > 0) {
ycant--;
}
if(Cantobj > 1){
Cantobj--;
println("Cantobj", Cantobj);
}
}
}
if (key == '+') {
soundsensibility+=sumator;
println("soundsensibility ", soundsensibility);
}
if (key == '}' && soundsensibility > 0) {
soundsensibility-=sumator;
println("soundsensibility ", soundsensibility);
}
if (key == 't') {
size+=sumator;
println("Size :", size);
}
if (key == 'g' && size > sumator) {
size-=sumator;
println("Size :", size);
}
if (key == 'y') {
modulo+=sumator;
println("Modulo :", modulo);
}
if (key == 'h' && modulo > sumator) {
modulo-=sumator;
println("Modulo :", modulo);
}
if (key == 'u' ) {
inc+=sumator * 0.1;
println("inc :", inc);
}
if (key == 'j' ) {
inc-=sumator * 0.1;
println("inc :", inc);
}
if (key == 'a') {
fill(0);
rectMode(CORNER);
rect(0,0,width,height);
println("Reset background ");
rectMode(CENTER);
}
if (key == 'd') {
isbackground = !isbackground;
println(isbackground, "isbackground : ");
}
//RESET
if (key == 'r') {
modulo = 0;
size = 30;
inc = 0;
cont = 0;
hue = 100;
sat = 150;
bri = 255;
Bhue = 80;
Bsat = 150;
Bbri = 0;
Cantobj = 0;
colormanual = true;
israndom = false;
println("Reset all");
Ccont = 0 ;
flagCcont=0;
}
if (key == 'q') {
israndom = !israndom;
println("Is random : ",israndom);
}
if (key == 'e') {
colormanual = !colormanual;
println("colormanual :",colormanual);
}
if (key == 'i' && colormanual) {
hue+=sumator;
println("hue", hue);
if (hue >= 255) {
hue = 0;
}
}
/*if (key == 'k' && colormanual && hue > 0) {
hue-=sumator;
print("Hue");
println(hue);
}*/
if (key == 'o' && colormanual && sat+sumator < 255) {
sat+=sumator;
println("Saturacion ", sat);
}
if (key == 'l' && colormanual && sat > sumator) {
sat-=sumator;
println("Saturacion ", sat);
}
if (key == 'p' && colormanual && bri+sumator < 255) {
bri+=sumator;
println("Brillo ", bri);
}
if (key == 'ñ' && colormanual && bri > sumator) {
bri-=sumator;
println("Brillo ", bri);
}
if (key == 'n' && trans+sumator <= 255) {
trans+=sumator;
println("Transparencia ", trans);
}
if (key == 'b' && trans > sumator) {
trans-=sumator;
println("Transparencia ", trans);
}
if (key == 'm') {
ismousemode = !ismousemode;
}
if (key == 'v') {
displaymode++;
if (displaymode == 6) {
displaymode = 1;
}
println("Display Mode : ", displaymode);
}
if (key == 'c' && cont > 0 ) {
cont--;
}
if (key == 'f' && Ccont > 0 && cont > 1) {
Ccont--;
}
if (key == 'z') {
npoints++;
print("npoints");
println(npoints);
}
if (key == 'x' && npoints > 1) {
npoints--;
print("npoints");
println(npoints);
}
if (key == '1' && Bsize > 0) {
Bsize-= sumator;
println("Bsize", Bsize);
}
if (key == '2' && Bsize+sumator <= 255 ) {
Bsize+= sumator;
println("Bsize", Bsize);
}
if (key == '3') {
Bhue+= sumator;
if (Bhue >= 255) {
Bhue = 0;
}
println("Bhue", Bhue);
}
if (key == '4' && Bsat >= sumator) {
Bsat-=sumator;
println("Bsat", Bsat);
}
if (key == '5' && Bsat+sumator <= 255) {
Bsat+=sumator;
println("Bsat", Bsat);
}
if (key == '6' && Bbri >=sumator ) {
Bbri-=sumator;
println("Bbri", Bbri);
}
if (key == '7' && Bbri+sumator <=255) {
Bbri+=sumator;
println("Bbri", Bbri);
}
if (key == '8' && Btrans+sumator <= 255) {
Btrans+=sumator;
println("Btrans", Btrans);
}
if (key == '9' && Btrans >= sumator) {
Btrans-=sumator;
println("Btrans", Btrans);
}
if (key == '+') {
sumator++;
println("Sumator",sumator);
}
if (key == '-' && sumator > 0) {
sumator--;
println("Sumator",sumator);
}
if (key == 'b'){
starorpoly = !starorpoly;
}
if (key == ' ' && Ccont <= cont && displaymode == 3) {
Ccont++;
pushMatrix();
translate(0,0,+20);
popMatrix();
if (Ccont == cont) {
Ccont = 0;
flagCcont = 1;
}
if (flagCcont == 0) {
flagCcont = 1;
}
}
if(key == 'B'){
saveFrame("img/####-spiro.jpg");
}
}
void mouseWheel(MouseEvent event) {
//float e = event.getCount();
// println(e);
if (event.getCount() == 1 || ( (event.getCount() == -1) && sumator > 1) ) {
sumator+= event.getCount();
}
println("Sumator : ", sumator);
}