TextureCache: What JSON meta is expected by addSpriteFramesWithJson?

Hello,

I’m trying to define sprite frames using a JSON file.
The TextureCache has a .addSpriteFramesWithJson() method, but I’ve found nowhere the data structure it expects.
The JSON output from TexturePacker doesn’t seem compatible.

Could you please let me know about the expected structure of the JSON object?
Thanks!

Hi Jem,

cc.SpriteFrameCache supports Json file now, you can pull the latest “develop” branch from github.

example codes:
cc.SpriteFrameCache.getInstance().addSpriteFrames(“res/aJsonFile.json”);

Regards
David

Hi David,

Thanks, upgrading to the latest version made it work like a charm!