Make the xmouse and ymouse variables match game coordinates

Ideas for Game Editor evolution.

Make the xmouse and ymouse variables match game coordinates

Postby MrScience101 » Sat May 19, 2007 1:36 pm

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.
User avatar
MrScience101
 
Posts: 115
Joined: Tue Mar 20, 2007 9:52 pm
Score: 13 Give a positive score

Postby Game A Gogo » Sat May 19, 2007 11:10 pm

Use "screen_to_actor(&xmouse,&ymouse);" and you have to worry about nothing at all!
But place at the start of the code.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby DilloDude » Sun May 20, 2007 6:45 am

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.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest