help pls.. How to get mouse position when click?

Non-platform specific questions.

help pls.. How to get mouse position when click?

Postby kengin » Wed Feb 29, 2012 10:14 am

help pls.. How to get mouse position when click?
User avatar
kengin
 
Posts: 11
Joined: Thu Nov 10, 2011 4:12 am
Score: 1 Give a positive score

Re: help pls.. How to get mouse position when click?

Postby Hblade » Wed Feb 29, 2012 5:48 pm

Create a variable using the script editor and clicking "Variables".

Create 2 of them, one named MX and one named MY. Both integers.

Now, create a filled region with the same size of the view (by dragging its corners), now add an event on the region, - Mouse Down - Left Button - Script Editor
Code: Select all
MX=xmouse;
MY=ymouse;


Now make a text actor called "Text" then drag it to the top left corner of the view, and go to script editor and type
Code: Select all
sprintf(text, "%d - %d", MX, MY);


Now when you click, the text will show you the X and Y.




To create a text actor make a normal actor and click the Text option in the actor properties and type something random in it after you selected your font.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: help pls.. How to get mouse position when click?

Postby kengin » Fri Mar 02, 2012 9:39 am

ow ty very much
i gave you + 1 xD
User avatar
kengin
 
Posts: 11
Joined: Thu Nov 10, 2011 4:12 am
Score: 1 Give a positive score

Re: help pls.. How to get mouse position when click?

Postby Hblade » Fri Mar 02, 2012 3:32 pm

Thanks! :) and no biggie.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest