My idea would be to calculate the rotation in the conversion from TMX tile to an Engo tile and store the rotation in degree on the Engo tile.
EDIT 3:
Another option might be to pass on the individual flags isFlippedDiagonally, isFlippedHorizontally, isFlippedVertically and leave it up to the implementer to work with it.
Thanks again for this awesome engine! When trying to build a road segment I found that rotated tiles are not rotated in-game.
In Tiled you can rotate tiles (with
z
) and it also stores it correctly, in the file :those are 4x the same tile but rotated (0º, 90º, 180º, 270º).
This is how it looks in Tiled:
This is how it looks in-game:
EDIT: This seems to be the location where the
Flipping
attribute gets lost and should be applied to the image?https://github.com/EngoEngine/engo/blob/d6f9c6aafb3d9124495edf7115b1b2fb0c35b9c8/common/tmx_level.go#L256-L261
EDIT2: this is the way Tiled calculates the rotation: https://github.com/mapeditor/tiled/blob/ba252f2bb1666510a2cf3851d105db443968f37c/src/libtiled/maprenderer.cpp#L383-L410
My idea would be to calculate the rotation in the conversion from TMX tile to an Engo tile and store the rotation in degree on the Engo tile.
EDIT 3: Another option might be to pass on the individual flags
isFlippedDiagonally
,isFlippedHorizontally
,isFlippedVertically
and leave it up to the implementer to work with it.