Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I this is the first time I am developing for BB10 OS using cocos2dx.

I need to read key value pair in Cocos2Dx.

eg: Skill= 5
Power= Awesome

The target is Blackberry 10OS and using QNX Momentics for development. Is there a library for this? Or as an alternate approach, if this can be a stored in a lua file, then how to parse the lua file to retrive these values, based on keys?

share|improve this question

1 Answer 1

cocos2d-x can parse .plist and store it in a CCDictionary. I suggest you use a plist rather than a normal txt file.

If you are using XCode, you can create from there.

To load the plist and store it in the dictionary, you can do this:

const char *plistPath = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath("myplist.plist");
CCDictionary *myKeyValuePairDictionary = CCDictionary::createWithContentsOfFileThreadSafe(pszPath);
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.