I am looking around trying to find the best way to display a general Tiled tilemap and then make each tile clickable so that I can use the clicked tile to pathfind the player to it. I am good with A* and all of that, but I am having a surprising time trying to figure out what tile the player has clicked on. I looked-through the documentation on Tile, which seems to be the low-level class that the tilemap will be made up of but didn’t find anything (unless it was right in front of me, which does happen a startling amount of the time these days).
Do I set a click event on each tile? That seems like it would be very inefficient. Or is this typically just done with calculations based on where in the canvas the user clicked and calculate with scroll offset, etc. to get the tile clicked? Are there any examples of this anywhere? Thanks!