We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, i just started using processing and i was wondering how i could make 4 buttons interactive. I want to be able to press a key on the keyboard and make the button do something when that happens.
Im going to use the program i made for an arduino car with bluetooth.
` void setup(){
size(500,500);
background(100,200,200);
}
void draw(){
fill(0,0,0);
rect(175, 162.5, 125, 62.5);
rect(175, 250, 125, 62.5);
rect(25, 250, 125, 62.5);
rect(325, 250, 125, 62.5);
fill(255,255,255);
text("W", 232,195);
fill(255,255,255);
text("S", 232,285);
fill(255,255,255);
text("A", 80 ,285);
fill(255,255,255);
text("D", 380,285);
}
`
Answers
Hey
I borrow some code for this forum. This is an idea of the many possibilities. You can also use controlP5 controls or G4P GUI builder:
Kf