void mousePressed() not working
in
Programming Questions
•
8 months ago
This is the general idea of what is happening in my program, but nothing within the if() statement is working, not even on the first click. All variables are declared outside of void. tfStatement is present in boolean statements within draw.
//
void mousePressed() {
if(dist(mouseX, mouseY, objectPosX, objectPosY) <= objectWidth/2) {
tfStatement = false;
print("stuff");
}
if(dist(mouseX, mouseY, object2PosX, object2PosY) <= object2Width/2) {
tfStatement = false;
print("stuff");
}
}
//
If there's any other information needed (such as what other loops are present in void draw(), I can provide whatever's relevant.
*Note: Creating a simple object with no background, translate, or rotate works fine. tfStatement seems to have no effect.
//
void mousePressed() {
if(dist(mouseX, mouseY, objectPosX, objectPosY) <= objectWidth/2) {
tfStatement = false;
print("stuff");
}
if(dist(mouseX, mouseY, object2PosX, object2PosY) <= object2Width/2) {
tfStatement = false;
print("stuff");
}
}
//
If there's any other information needed (such as what other loops are present in void draw(), I can provide whatever's relevant.
*Note: Creating a simple object with no background, translate, or rotate works fine. tfStatement seems to have no effect.
1