I am trying to make sure that the user cannot move the mouse outside the canvas. I have managed to do it using lots of if endif's but this is very untidy, is there an easier way.
Here is my way...
...this just checks the left most X position.
If the mouse is outside the edge of my canvas it is put back inside. The only problem is that the pointer can be drawn outside if you move the mouse fast enough.
Here is my way...
If MouseX(Desktop()) < (ClientWidth(Desktop()))/2-374 MoveMouse (ClientWidth(Desktop()))/2-374,MouseY(Desktop()) FlipCanvas(currentcanvas) EndIf
...this just checks the left most X position.
If the mouse is outside the edge of my canvas it is put back inside. The only problem is that the pointer can be drawn outside if you move the mouse fast enough.