Trying to give high level access to tile rotation and other transform related information by implementing a GetTileTransform() method that returns a TileTransform object.
Said object contains:
int Rotation => tile rotation in degrees inferred by flip flags
Flip flip => original flip flags minus the ones translated into a rotation
Flip flipRaw => original flip flags
Point offset => tile offset to keep position unchanged after a rotation around its upper-left corner
I had a request to implement this in my MonoGame example repository, but seems reasonable to have it built into TiledCS.
This simplifies implementation for MonoGame by a lot, and I hope for other platforms too.
It is a known issue that when all flip flags are true (and you get both rotaton and flip in the TileTransform) the result of the transformation depends on the order these transformation are applied. It is implemented so that the rotation has to be applied first, and works fine with MonoGame, but may require some more attention.
Trying to give high level access to tile rotation and other transform related information by implementing a GetTileTransform() method that returns a TileTransform object.
Said object contains:
I had a request to implement this in my MonoGame example repository, but seems reasonable to have it built into TiledCS. This simplifies implementation for MonoGame by a lot, and I hope for other platforms too.
It is a known issue that when all flip flags are true (and you get both rotaton and flip in the TileTransform) the result of the transformation depends on the order these transformation are applied. It is implemented so that the rotation has to be applied first, and works fine with MonoGame, but may require some more attention.