cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
https://www.cocos.com/en/cocos2d-x
18.24k stars 7.06k forks source link

Adding Tiled JSON support through TMXMapInfo #18945

Open seivan opened 6 years ago

seivan commented 6 years ago

From the code, it seems parsing the XML returns a TMXMapInfo and that on its own is used to build the entire map.

With the assumption that the created TMXMapInfo does not contain XML specific content, wouldn't it be possible to create one using JSON as well, thus supporting both?

Granted, this relies on using the JSON parser to create a TMXMapInfo, but I from what I can tell, there is a JSON parser bundled.

stevetranby commented 6 years ago

This shouldn't be difficult, just requires someone's time. It's also tedious work. Since Tiled's latest version still supports exporting to XML there's likely no priority for this. Feel free to submit a PR using the bundled rapidjson library (examples exist in engine test project sources).

It's possible the Cocos Creator project has some or full support for parsing the JSON version.