Pytiled-parser

Latest version: v2.2.3

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

Scan your dependencies

Page 2 of 4

2.1.0

This is largely a compatibility update to work with the latest version of Tiled. This version represents the first version of pytiled-parser that is compatible with the formats from Tiled 1.9. Previous versions do not work with maps or tilesets of either JSON or TMX formats from Tiled 1.9 or higher, if you need to use Tiled 1.9+ with an older version of Tiled, you will need to use Tiled's ability to save the map in compatibility mode.

This update does introduce a slight API breaking change, but is unlikely to really cause any problems. The `type` attribute has been removed from the `TiledObject` class as well as the `Tile` class. It has been replaced with the `class_` attribute. This is in keeping with following Tiled's own API as closely as possible. There shouldn't really be any functional difference here, in most cases it has just been re-named. For more information on this change, you can reference the [Tiled JSON format changelog](https://doc.mapeditor.org/en/stable/reference/json-map-format/#changelog).

It is important to note, that this update does not add support for new features introduced in Tiled 1.9(and in fact, we are still missing support for some features from 1.8). This update is primarily to ensure that maps using the base feature set we have had support for will continue to work with the same supported featureset on Tiled 1.9. Support for the new features is something we would like to achieve, but we did not want to hold back general compatibility for it.

Outside of that, all other changes are to the internal parsers and do not effect usage/implementation of pytiled-parser.

2.0.1

Someone, not naming any names, forgot to put `__init__.py` files in some packages, and caused imports to break when installed via a `.whl` and not an editable source install. This just fixes that problem.

2.0.0

Welcome to pytiled-parser 2.0! A lot has changed under the hood with this release that has enabled a slew of new features and abilities. Most of the changes here are under the hood, and there is only really one major API change to be aware of. However the under the hood changes and the new features they've enabled are significant enough to call this a major release.

The entire pytiled-parser API has been abstracted to a common interface, and the parsing functionality completely
seperated from it. This means that we are able to implement parsers for different formats, and enable cross-loading between formats.

With the release of 2.0, we have added full support for the TMX spec. Meaning you can once again load TMX maps, TSX tilesets, and TX templates with pytiled-parser, just like the pre 1.0 days, except now we have 100% coverage of the spec, and it's behind the same 1.0 API interface you've come to know and love.

If you're already using pytiled-parser, chances are you don't need to do anything other than upgrade to enable TMX support. The `parse_map` function still works exactly the same, but will now auto-analyze the file given to it and determine what format it is, and choose the parser accordingly. The same will happen for any tilesets that get loaded during this. Meaning you can load JSON tilesets in a TMX map, and TSX tilesets in a JSON map, with no extra configuration.

The only thing that can't currently be cross-loaded between formats is object templates, if you're using a JSON object template, it will need to be within a JSON map, same for TMX. A `NotImplementedError` will be raised with an appropriate message if you try to cross-load these. Support is planned for this in likely 2.1.0.

The only API change to be worried about here is related to World file loading. Previously in pytiled-parser if you loaded a World file, it would also parse all maps associated with the world. This is not great behavior, as the intention of worlds is to be able to load and unload maps on the fly. With the previous setup, if you had a large world, then every single map would be loaded into memory at startup and is generally not the behavior you'd want if using world files.

To remedy this, the `WorldMap.map_file` attribute has been added to store a `pathlib.Path` to the map file. The previous API had a `WorldMap.tiled_map` attribute which was the fully parsed `pytiled_parser.TiledMap` map object.

1.5.4

Previously if only one parallax value(x or y) on a layer had been set, it would fail because pytiled-parser was assuming that if one was set then the other would be. This is not actually the case in the Tiled map file.

The value for them now defaults to 1.0 if it is not specified in the map file(This is the Tiled default value).

1.5.3

Just a small bugfix in this release. Previously if a layer's offset was (0, 0), the values for it would not appear in the JSON file, so the `offset` value in the
Layer class would be `None`. This can cause some unexpected behavior in engines or games, and puts the responsibility of checking if this value exists onto the game or engine using it.

This value has been changed to default to (0, 0) if it is not present in the JSON so that games can apply it easily in one line and always get the same result without error.

1.5.2

This release contains some re-working to properly support templates.

Previously templates were supposedly fully supported, however they were broken for tile objects. Now there should be out of the box support for auto-loading tile objects from templates. Regardless of where the tileset is defined. See Issue https://github.com/benjamin-kirkbride/pytiled_parser/issues/41 for details

There are no API changes as far as usage is concerned, these were all internal changes to properly support the feature.

This release also contains some minor fixes to docstrings and typing annotations/linting problems.

Page 2 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.