Mouse Position

by Kaiochao
Get the position of the mouse in the screen or the world.
ID:2261604
 
The following procs are provided by a /mouse_position datum given to /client:
  • X()
  • Y()
  • WorldX()
  • WorldY()
  • ScreenLoc()
  • IsOverMap()
  • Moved()

Changelog

8/24/18
  • Changed how client.mouse_position is initialized, for easier overriding. Maybe you want to initialize it to some child of /mouse_position with your own Moved() override. Or something like that.
  • Added IsOverMap() so you can tell if the mouse is actually over a map.
  • Added ScreenLoc().
  • Added Moved(), a callback for when the mouse moves. This is one proc that gets called whenever the mouse moves over the map. Without this, you'd have to override client.MouseMove(), MouseDrag(), and MouseEntered() in order to catch every time the mouse moves.