Hi guys, I am writing a method that gets data about the current tile the Mouse (or Touch Input) is currently hovering over, using TouchInput._x and TouchInput._y (I've also tried TouchInput.x and TouchInput.y; it works similarly) as arguments for the $gameMap.canvasToMapX method to determine which tile to get info for.
But if the Mouse is outside of the Game Window, I want to return a 0 for all data. What's actually happening in practice is it returns the data at the last point on the Game Window that the mouse was at before moving it off the Game Window - TouchInput._x and ._y aren't updated anymore until returning to the Game Window.
Even stranger, it seems that if I hold the mouse button down while moving off the Game Window, it will continue to update correctly with every movement (even outside the window), until I release the mouse button.
Is there any way I can get the current mouse position, regardless of clicking or holding the mouse, even while the mouse is offscreen? Alternatively, is there any graceful (not super-expensive) way to continually update TouchInput.x/y while the mouse is outside the game window?
But if the Mouse is outside of the Game Window, I want to return a 0 for all data. What's actually happening in practice is it returns the data at the last point on the Game Window that the mouse was at before moving it off the Game Window - TouchInput._x and ._y aren't updated anymore until returning to the Game Window.
Even stranger, it seems that if I hold the mouse button down while moving off the Game Window, it will continue to update correctly with every movement (even outside the window), until I release the mouse button.
Is there any way I can get the current mouse position, regardless of clicking or holding the mouse, even while the mouse is offscreen? Alternatively, is there any graceful (not super-expensive) way to continually update TouchInput.x/y while the mouse is outside the game window?