i just go this:
boolean InButtonSelection1 = true;
void setup() {
size(1920, 1080);
background(222);
}
void draw() {
background(222);
// evaluate InButtonSelection1
if (InButtonSelection1) {
fill(255, 0, 0);
rect(100, 100, 250, 250);
} else {
fill(222);
stroke(222);
rect(100, 100, 250, 250);
}
}
void mousePressed() {
// set InButtonSelection1
if (mouseY > 100 && mouseY < 350 &&
mouseX > 100 && mouseX < 350 ) {
// toggle InButtonSelection1
if (InButtonSelection1) {
InButtonSelection1 = false;
} else {
InButtonSelection1 = true;
}
}//if
//
}
//