Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

High level tile rotation access #97

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

ironcutter24
Copy link

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant