Page 1 of 1

Make the xmouse and ymouse variables match game coordinates

PostPosted: Sat May 19, 2007 1:36 pm
by MrScience101
It would be helpful if the xmouse and ymouse global variables actually matched the game editor x and y coordinates. For instance the xmouse goes from 0 to 320 and ymouse goes from 0 to -240. Instead make the xmouse match the view in game editor. So xmouse would go from possible -160 to 160 and ymouse would go from -120 to 120 depending upon how your view is set up. This way we do not have to convert the xmouse and ymouse variables to our game coordinates.

PostPosted: Sat May 19, 2007 11:10 pm
by Game A Gogo
Use "screen_to_actor(&xmouse,&ymouse);" and you have to worry about nothing at all!
But place at the start of the code.

PostPosted: Sun May 20, 2007 6:45 am
by DilloDude
Use xmouse + view.x to get mouse coordinates relative to game centre.
If you want to access it like a variable, then open up global code and add
Code: Select all
#define mousex (xmouse+view.x)
#define mousey (ymouse+view.y)

Then you can just use mousex and mousey.