PyxelEdit is a tool I’m using for tilesets and animations, and Tiled is a map editor I’m using for making some maps in The Enchanted Cave 2. PyxelEdit’s great for working on the fly at creating new tilesets and maps at the same time, but normally to get the map in the game, I would have to rebuild the map in Tiled from an exported tilesheet. I noticed that the both have an option to save and write maps as xml files, so I wrote a tool to convert the map data from the xml file PyxelEdit creates to the .tmx file that Tiled reads, and wanted to share it for any other devs that use both tools or were considering it:
You can download the .zip file here.
You can also download the source here if interested: (It uses HaxeFlixel)
Not too flashy, but it doesn’t have to be.
Instructions are all there in the program, and the .tmx file is saved to the same folder as the .exe. The name of the output .tmx is automatically set to the same name as the xml file when you select that, but you can name it anything you want.
PyxelEdit doesn’t have the capability to have a different tileset for each layer like Tiled, so if you’re like me and have a separate layer in Tiled for hit detection or objects, you may have to re-do those each time… However a relatively easy workaround for this if the number of tiles in your tileset hasn’t changed since last time is to open your old .tmx file in Notepad++ or whatever (it’s just xml) and manually copy and paste your objects and hit collision layers over to the .tmx the conversion tool spits out.
If the number of tiles in your tileset has changed it’s a bit tricker to copy and paste the layers you need because tiled’s “firstgid” properties on the tilesets will be off. What you can do is manually adjust these by the difference in number of tiles from last time, and you should be good.
Finally, Tiled’s default format is to compress the data with zlib compression, so if your game uses those files and decompresses them in-game, you’ll just need to open the created .tmx, and set the “Layer Format” under Map -> Map Properties to the zlib compression because it will be set to XML.
I hope this helps some people!