jsonphaser-frameworktiledtmx

Get a .tmx file from its .json


I've been using Tiled to create .tmx maps for one of my projects, maps that I export to JSON before using with Phaser.js.

Problem is, a few months ago I mistakenly deleted the .tmx file for the game first map. It's still working fine but now I can't change anything on the first map layout with Tiled because I only have the JSON for it.

I've been looking for an answer with no success so far, but is there a way to convert a .json Tiled map exported from a .tmx file, back to its original format ?


Solution

  • You should be able to simply open the JSON exported map in Tiled, and save it again as a TMX file. To be able to select the file, you may need to change the file type in the Open File dialog.

    Btw, you should consider committing your project to a version control system (Git is a popular one), so that such mistakes will not generally lead to loss of data. You don't always get lucky.