Hello,
Hope you can help.
I have simplified my sketch to two buttons (of 16), each button should call a draw method of a shape rotated, (pop1c for button one) and (pop2c for button two).
Because I have a method doAll() the pop1c(20, 20) & pop2c(80, 80) need to be incorporated at the bottom of the doAll() method to run, BUT this means they are run at the same time. How can I separate them? I enclose my code, and further down the button code to go on a separate tab.
//MAIN SKETCH
int x ;
int y ;
int a =0;
int i =0;
Button button1, button2;
boolean checker, checker2;
void setup() {
size(800, 800);
background(255);
boolean checker = false;
boolean checker2 = false;
button1 = new Button (x+20, y+20, 60);
button2 = new Button (x+120, y+20, 60);
}
void draw() {
background(255);
button1.update();//display button
button1.display();//refresh every frame
button2.update();//display button
button2.display();//refresh every frame
if (checker) { //If the button is pressed run shape rotated and translated
doAll();//new method that contains translate, rotate
}
}