constrain has not to do with it
void mousePressed() {
if (mouseX >= x &&
mouseX <= x+widthRect &&
mouseY >= y &&
mouseY <= y+heightRect) {
// do something
} else {
// nothing
}
}
constrain has not to do with it
void mousePressed() {
if (mouseX >= x &&
mouseX <= x+widthRect &&
mouseY >= y &&
mouseY <= y+heightRect) {
// do something
} else {
// nothing
}
}