ID:155133
 
Hello BYOND, haven't seen you in a while ;)

Anyways, following 490 being released, I decided to try to
make a TD game, however I'd like to, in this TD game, get the
current location of the mouse, to the pixel, at any time. How
should I go about doing this?

Thanks, Gigimoi
Forum Account just released a library for this that doesn't involve javascript. It's still on the front page of the resources.
In response to Robertbanks2
It uses 30% cpu just from me rapidly moving my mouse, whereas HDK's doesn't lag at all (it may generate 1% but that's it).

Forum_account's is easier to configure

HDK's is less laggy.
In response to Ill Im
Ill Im wrote:
It uses 30% cpu just from me rapidly moving my mouse, whereas HDK's doesn't lag at all (it may generate 1% but that's it).

Forum_account's is easier to configure

HDK's is less laggy.

You forgot the part where HDK's is reliant upon javascript and tends to not work for a lot of people because of issues with JS. It's more efficient, but not as reliable. It's just a tradeoff that you have to accept between the 2, FA's is more accessible but less efficient, HDK's will alienate some players because they can't use the JS, but is considerably more efficient.
In response to Ill Im
You can adjust the resolution so it'll capture the mouse's position to within an 8x8 pixel box, 4x4, 2x2, or 1x1. The additional precision might be causing the additional CPU usage, but 30% sounds very high. The library is just capturing MouseEntered events. If it's capturing that many events, it could be a BYOND bug, because there's not much difference between moving the mouse quickly when you're using the library vs. moving the mouse quickly when you're not using the library.