pythonarcade / pytiled_parser

Python Library for parsing Tiled Map Editor maps.
MIT License
32 stars 20 forks source link

Tiled Object 'rotation' attribute not accurate between docs and implementation #20

Closed benjamin-kirkbride closed 4 years ago

benjamin-kirkbride commented 4 years ago

https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#object says:

rotation: The rotation of the object in degrees clockwise around (x, y) (defaults to 0).

This is inaccurate. By default, the rotation attribute is absent for ALL object types.

This is a relatively minor issue, but a decision must be made as to assign a rotation value of 0 to all objects that lack a rotation attribute, or to set it to None.

benjamin-kirkbride commented 4 years ago

For now I will set it to None because it is the least amount of work and easiest to justify (it matches the implementation, which is what 99% of anticipated users will care about).

benjamin-kirkbride commented 4 years ago

This will need reviewed before the 1.0.0 release

benjamin-kirkbride commented 4 years ago

Left an issue with the Tiled project here: https://github.com/bjorn/tiled/issues/2784

This is part of a series of issues relating to differences between the docs and implementation of Tiled with the parent issue being here: https://github.com/Beefy-Swain/pytiled_parser/issues/19

benjamin-kirkbride commented 4 years ago

Turns out I was missing a critical piece of the docs that explains this.

See: https://github.com/Beefy-Swain/pytiled_parser/issues/19#issuecomment-617525932