-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jsonformat #1868
Jsonformat #1868
Conversation
…mat and use that instead
The format is still mostly the same, so the code for reading all the tile attributes can be shared.
Thanks a lot for your work on this! |
Thx for your good work @saeedakhter! Just wondering @bjorn, does the snapshot build contain this change? I was writing a parser on C# for my specific use-case and realize it would have been much easier with this updated |
@bitinn Yes, the changes are included in the latest snapshot build. The JSON format documentation is also already updated, which means it's now actually time to host explicit "Tiled 1.1" documentation (probably as default) as well to avoid confusion. |
@bjorn fantastic! and yeah I was reading the doc and realize |
Addresses issue #1585
This introduces a new json revision (version: 1.2) that is much easier to serialize and de-serialize. For an example of de-serializing the new format in Unity3d, see https://github.com/saeedakhter/TiledJsonUnity3d
Problem:
Tiles were serialized as a map with the tile ID as the key:
In Unity3d, this makes it difficult (impossible?) to use Unity3d's JSON deserialization:
https://docs.unity3d.com/Manual/JSONSerialization.html
Solution (this pull request):
Serialize tiles and properties as a list. If an ID is required, put it inside the list object. Example: