Page 1 of 1

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

PostPosted: Wed Feb 29, 2012 10:14 am
by kengin
help pls.. How to get mouse position when click?

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

PostPosted: Wed Feb 29, 2012 5:48 pm
by Hblade
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.

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

PostPosted: Fri Mar 02, 2012 9:39 am
by kengin
ow ty very much
i gave you + 1 xD

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

PostPosted: Fri Mar 02, 2012 3:32 pm
by Hblade
Thanks! :) and no biggie.