Translating MOUSE coordinates
in
Programming Questions
•
7 months ago
Hi,
I have created a button in my application by defining certain region of action of mouse.
if(mousePressed && 30 < mouseX && mouseX < 200 && 100 < mouseY && mouseY < 200 ) {
fill(100,30,123);
rect(30,100,270,100);
}
and after that I applied a translation
translation(0,0);
if(mousePressed && 30 < mouseX && mouseX < 200 && 100 < mouseY && mouseY < 200 ) {
fill(100,30,123);
rect(30,100,270,100);
}
but here the rectangle gets translate but the mouse still works on that certain region only it doesn't shift. Can you tell me how to translate everything ( rectangle + mouse)
1