Get clicked tile coordinates

● ARCHIVED · READ-ONLY
Started by Astro785 3 posts View original ↗
  1. Hello,

    I'm looking for a way to get the x and y coordinates of a tile that has been clicked with the mouse. I need the actual grid coordinates, not the canvas coordinates.

    I need to override a game method to perform an action with the specific coordinates on each click on a tile.

    Thank you for enlightening me !
  2. When you click on a tile on the map, it calls $gameTemp.setDestination(x,y). You can then use $gameTemp.destinationX() and $gameTemp.destinationY() to get those coordinates. You can also use $gameTemp.isDestinationValid() to return a true/false value indicating whether a tile HAS been clicked with the mouse.
  3. Thank you very much, that's what I just found after searching for hours. But i'm sure this thread will help other people :)