Tilemap - Retrieve tile's ID when mirrored

Hello,

Since the new version v1.3.2-x64 of aseprite, we can now generate a Tilemap with tile’s flip property.

But it seems that when I want to retrieve, through API, the ID of the tile in question, the ID is a very large number that doesn’t correspond to anything.

The method used to retrieve ID is: tilemap:getPixel(x, y) with X, and Y the tile position in the Tilemap.

Is there a way to get the Tile ID and if it’s mirrored ?

Thanks in advance.

I’d try app.pixelColor.tileI and app.pixelColor.tileF, which decompose a map entry into its index and flipping flags. app.pixelColor.tile composes an index with its flipping flags to create a complete map entry.

The flipping flags for X, Y and D can be found in the source code, as well as the logic for how the functions above work:

The flags are the same as in Tiled, btw, which makes export nice and easy:

https://doc.mapeditor.org/en/stable/reference/global-tile-ids/#gid-tile-flipping

1 Like

oh, this is very good !
With app.pixelColor.tileI and app.pixelColor.tileF I can now retrieve all informations I need for my lua script.

Maybe the official API documentation will write this type of usage.
Tiles management is still fairly new in software.

Thanks.