JSON data of tiles in a map

Hello, I want to read the JSON file exported by tiled.
I need to know what field or property indicates if a tile is rotated and in which angle and direction (horizontal / vertical) is rotated ?.

I have seen this but I can not find what I am looking for:
http://doc.mapeditor.org/en/latest/reference/json-map-format/

The global tile IDs stored in the JSON format are the same as for the TMX format. You can read up on global tile IDs here:

http://doc.mapeditor.org/en/latest/reference/tmx-map-format/#data
http://doc.mapeditor.org/en/latest/reference/tmx-map-format/#tile-flipping

There is no explicit rotation bit, but from the three flipping bits you could derive the rotation if you need it (just note that the tile isn’t only rotated, but may also be flipped).

Hello, thanks for the information.
Please, I have a misunderstanding with this information:
bit 30 indicates whether the tile is flipped (anti) diagonally, enabling tile rotation.

What does it mean? What should I do if that bit is 1?
Should I rotate the tile 90 degrees?

Sin tĂ­tulo-1

No, it’s a plain flip, but along the diagonal:

diagonalflip

So it swaps the X and Y axis of the image. It is the same as “horizontal flip + rotate 90 counter-clockwise” or “vertical flip + rotate 90”.

1 Like