MouseX and Y to Canvas?!
BlitzMax Forums/MaxGUI Module/MouseX and Y to Canvas?!
| ||
I have a Max2D canvas displaying my game, how would I go about feeding the input into the canvas? |
| ||
http://www.blitzbasic.com/bmdocs/command.php?name=CreateCanvas&ref=gui_cat |
| ||
Hi BLaBZ, it's quite simple actually. Check for EVENT_MOUSEMOVE and store the values given by EventX() and EventY() in global variables. Eg: global canvasx:int, canvasy:int repeat event=waitevent() source=eventsource() select event case EVENT_MOUSEMOVE and source=yourcanvas canvasx=eventx() canvasy=eventy() end select forever You can then use canvasx and canvasy all over you code as synonyms to Mousex() and MouseY(). |