12-21-2024, 03:47 PM
Arrays are how I go for complex mouse mapping. Just store the upper-left and lower-right point of the box where the mouse click is valid. Most times however, I just assign areas which can be calculated easily with a little math for my mouse areas.
For i = 0 to 5 '5 boxes to click in as a menu
line (100,i * 100 + 100) - step (400,100), kolor(i), BF 'this is one boxed area
Next ' this little bit draws the boxes
While _MouseInput: Wend
If _MouseX > 100 and _MouseX < 500 Then 'it's within the left-right box area
boxclicked = INT((_MouseY - 100) / 100) 'this tells us if we clicked inside the proper Y area for each designated box.
End IF
That's all there is to it! Quick to create, even quicker to check for coordinates.
For i = 0 to 5 '5 boxes to click in as a menu
line (100,i * 100 + 100) - step (400,100), kolor(i), BF 'this is one boxed area
Next ' this little bit draws the boxes
While _MouseInput: Wend
If _MouseX > 100 and _MouseX < 500 Then 'it's within the left-right box area
boxclicked = INT((_MouseY - 100) / 100) 'this tells us if we clicked inside the proper Y area for each designated box.
End IF
That's all there is to it! Quick to create, even quicker to check for coordinates.