I have a json file which contains my sprite animation details.How can I use in my cocos2d-x game using c++ in ios .I am using xcode.Can any one please please help me.I am really in a need of this.Please share the code if anyone has.
Here’s a basic example (disclaimer: not compiled, should be ok though):
void MyClass::loadJson(const char* json)
{
rapidjson::Document doc;
doc.Parse<0>(json);
if (!doc.HasParseError())
{
auto email = doc["email"].GetString();
}
};
Remember to #include "json/document.h"
either in your implementation or definition (header).