Hello everyone!
I’ve picked up the trial version of Corona and am trying to set up basic functions to support isometry to test out the framework before buying a copy.
I want my isometric grid to be zoomable and scrollable, which I have achieved with ease. However, my isometric cells must also respond to tap events.
I set up an isometric cell as a cell outline, created with display.newLine, and an image created with display.newImage (displaying a predrawn isometric cell).
Obviously, the images of isometric cells overlap, and when a cell that is surrounded by other cells is tapped, several tap events are generated, and I need to filter out the cells for which images were clicked, but outside the visible area (to find out which cell was truly tapped).
My first attempt at solving this problem was to explicitly check if the tap is within the area of the outline - by creating functions for each tile that returned if a specific coordinate lies within the tile. The problem with this is accounting for the transformations that I apply to the group that contains my isometric cells. Also, manually doing inverse transformation math for every time a cell is tapped seems excessive, especially since it’s already done for the image automatically.
So, my problem is this: I need a good way to precisely check which isometric cells were tapped, despite their transformations. By “precisely check” I mean determine of the visible area of an isometric cell was clicked (and not just it’s 2D-Image bounding-box).
Any help with finding the best solution to this problem would be highly welcome, as isometry is essential to the games I plan on writing with Corona.
[import]uid: 8145 topic_id: 1698 reply_id: 301698[/import]