Pytiled-parser

Latest version: v2.2.7

Safety actively analyzes 681812 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

2.2.7

Fixes a bug when using the TMX format, where multi-line String properties would not be correctly parsed, as they are placed differently in the XML than single line strings. (75)

The Tiled docs also state that this multi-line format may in the future be used for all property values, so this change will help to futureproof against that.

2.2.6

Fixes a bug where properties did not load as expected on objects when using object templates. As of this release, the functionality is such that if properties are defined on both an object, and it's template, they will both end up on the resulting object, with the ones defined directly on the object overriding any properties that have the same name from the template. It does not compare types, so a String property with the name `test` would override a number property with the name `test`, as an example. Comparing types could be done in the future, but is likely more complicated than it's worth doing right now.

Fixes a bug where the TMX parser would report all layers as top level layers, ignoring the layer group nesting. This bug was not present in the JSON parser. (74)

Also handles some small deprecation warnings related to true/false comparisons of etree.Element classes in the TMX parser.

2.2.5

Adds a `__all__` section to the main library `__init__.py` file which fixes problems when running pyright in strict mode against this library, it would not be able to see the exported types.

2.2.4

Small change to the default text color, in Tiled the text color defaults to blac(0, 0, 0), previously in pytiled-parser if the color was not specified it would default to white(255, 255, 255). This has been changed to match Tiled's behavior [70](https://github.com/pythonarcade/pytiled_parser/pull/70)

Added a py.typed file in order for type checkers to identify the library as being typed properly.

2.2.3

Exposed tileset parsing more directly. This was possible by accessing the largely internal interfaces within pytiled_parser already, but this provides the same interface for parsing Tilesets as we have for parsing maps. You can parse a tileset by simply passing the filepath to `pytiled_parser.parse_tileset(file)` where `file` is a `pathlib.Path` object.

We have also removed some unnecessary `Optional` typing from some attributes. This does technically mean there are changes to the API, but they shouldn't really effect anything. The `pytiled_parser.Tile.width` and `pytiled_parser.Tile.height` attributes will now default to 0 if they are not set. Under normal circumstances there does not exist a scenario where they can not be set, the only use case that would cause this to happen would be if the map/tileset file does not follow the Tiled specification. The `pytiled_parser.TiledMap.map_file` attribute is also no longer optional, but does not have a default. This does mean if you were using the constructor for this class directly instead of the parsing functions, you would need to fix your usage of it, however it is extremely unlikely that anyone is doing that.

2.2.2

Switched to `pyproject.toml` for project setup. This should have no impact on users unless you are on a very old version of pip. If pip fails to install pytiled-parser, please try updating pip.

Fixed a bug in the TMX format where overriding or adding extra elements/attributes to object templates would not be applied. Only the id and the x, y position would be used. Now any overriden values(including properties) should be applied to the template. This bug did not exist in the JSON format, however there was no test coverage for this scenario in either format, that has since been added.

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.