SA-MP Forums Archive
Mouse position - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Mouse position (/showthread.php?tid=418293)



Mouse position - Misiur - 24.02.2013

Is it possible to detect mouse position while player is in spectate mode? There is an old experimental script by iPLEOMAX ( http://pastebin.com/aeFaYY2N ) but it's not very efficient. Are there some new methods of getting mouse position on screen grid?


AW: Mouse position - NaS - 24.02.2013

Thats the only way it's possible, by getting the camera front vector to move the mouse, which is no real mouse.

There is no explicit function for getting the mouse position directly, only through clickable textdraws.


Re: Mouse position - Misiur - 24.02.2013

Well, damn. I wanted to create simple drag&drop but I can get position only onclick using textdraws. Maybe in near future...


AW: Mouse position - NaS - 24.02.2013

Well you could get to work "drag and drop" by clicking whatever you want to drag and then clicking the destination as second.


Re: Mouse position - Misiur - 24.02.2013

Of course, but this isn't fancy enough


Re: Mouse position - RajatPawar - 24.02.2013

You could detect the mouse position onplayerupdate and move the textdraw there ! Which would create a 'drag and drop' effect!


Re: Mouse position - Misiur - 24.02.2013

Well, the problem is that I _can't_ detect the mouse position. I wanted to port good ol' javascript drag and drop (using onmousemove event with debouncer), but there isn't function in pawn which would return mouse coordinates. You can only emulate it while player is not spectating, and by getting position of textdraw which gets clicked.