Code Efficiency
in
Programming Questions
•
1 year ago
Hi,
is there a more efficient way to detect a mouseover than this?
- cirLocx = 100;
- cirLocy = 100;
- cirSize = 50;
- cirSize = 50;
- if ((mouseX >= (cirLocx - (cirSize * .5)) && mouseX <= (cirLocx + (cirSize * .5))) && (mouseY >= (cirLocy - (cirSize * .5)) && mouseY <= (cirLocy + (cirSize * .5)))){
- executeSomeCode();
- }
Thank you
1