Get clicked tile coordinates

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 !
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.
Thank you very much, that's what I just found after searching for hours. But i'm sure this thread will help other people 🙂

Original thread: https://forums.rpgmakerweb.com/threads/get-clicked-tile-coordinates.93320/