I have this code I use to check if an icon is selected -> hence, if the mouse is OVER a specific area of the screen
(i use this in my main loop while reading mousex() and mousey()
Local x1: Int = X_of_image
Local x2: Int = X_of_image+ width_of_Image
Local y1: Int = Y_of_image
Local y2: Int = y_of_image + height_of_image
If MouseX() > x1 And MouseX() < x2
If MouseY() > y1 And MouseY() < y2
...
DO SOMETHING! WE ARE OVER THE AREA
...
EndIf
EndIf '
is there a smarter way? and for the standard windows mouse pointer will this trigger only, and only when the upper left corner of the mouse is within the area?
(i use this in my main loop while reading mousex() and mousey()
Local x1: Int = X_of_image
Local x2: Int = X_of_image+ width_of_Image
Local y1: Int = Y_of_image
Local y2: Int = y_of_image + height_of_image
If MouseX() > x1 And MouseX() < x2
If MouseY() > y1 And MouseY() < y2
...
DO SOMETHING! WE ARE OVER THE AREA
...
EndIf
EndIf '
is there a smarter way? and for the standard windows mouse pointer will this trigger only, and only when the upper left corner of the mouse is within the area?