I would like to programmatically create my own maps in Tiled,
I’ve skimmed the tsx format and I’ve noticed it’s XML based and I saw that PyTMX is available for reading TSX files.
I was wondering if there is any library, (maybe PyTMX supports writing TSX files too? I didn’t use it, only skimmed the GH page), which allows manipulating and creating my own TSX files, if not - it looks like the PyTMX is a good candidate to add support for writing and creating those files
So, is there any python library which allows this? Does it have any documentation or examples?
Regarding python-tmx, it’s really simple: create a tmx.TileMap object (with the regular constructor for a new one, or with tmx.TileMap.load for an existing one), modify its attributes in the way you want, and then use the “save” method on that TileMap object. Here’s an example I whipped up of creating a new TMX file from scratch (it also creates a TSX file, that’s just as simple as setting an external file name for the tileset):