hmmm ... is the keyPressed() not working ?
is anyone alive
?
When i put the void keyPressed (){} instead of if(keyPressed==true) returns a not expected void .
and I want 1 key pressed = 1 letter.
<code>
void setup(){
size(800,600);
smooth();
}
float fontSize=1.5;
byte v1x, v1y, v2x, v2y, v3x, v3y, v4x, v4y;
float l1x, l1y, l2x, l2y;
int e1x, e1y, e2x, e2y;
int tx = 10;int ty=10;
void draw(){ keyPressed();
LetterA();
keyPressed();
LetterO();
}
int LetterA(){
if(keyPressed==true)
if (key == 'a'){
translate(tx,ty);
scale(fontSize);
line(v1x, v1y, v2x, v2y);
line(v3x, v3y, v4x, v4y);
line(l1x, l1y, l2x, l2y);
scale(fontSize);
translate(tx,ty);
v1x=10;v1y=15;
v2x=15;v2y=0;
v3x=15;v3y=0;
v4x=20;v4y=15;
l1x = 12.5;l1y = 7.5;
l2x = 17.5;l2y = 7.5;
tx+=35; ty+=0;
if (tx>600){
tx=0;
ty+=30;
}
redraw();
}
return 0;
}
int LetterO(){
if(keyPressed==true)
if (key == 'o'){
translate(tx,ty);
scale(fontSize);
ellipse(e1x, e1y, e2x, e2y);
scale(fontSize);
translate(tx,ty);
e1x=10; e1y=8; e2x=10;
e2y=10;
tx+=35;ty+=0;
if (tx>600){
tx=0; ty+=30;
}
redraw();
}
return 0;
}
</code>