Finding the Resource Path?

Finding the Resource Path?
0.0 0


What is the proper way using cocos2d-x on the iPhone to find the resource path. I would like to open .txt files that I have stored in the resource path.

Thanks Advance.


Try to use this. It works for me and texture loader also uses it.


Jirka Fajfr


You can also set the resource path to a known directory (like the standard asset directory, if there’s such a thing for iOS). That way you can always be sure that your data will exist at said location.

See CCFileUtils for more about that (afaik it was something like “setResourcePath”, don’t have the code with me right now).

Unfortunately, it’s not possible (to my knowledge) with current Cocos2d-x to set multiple resource paths and have resources automatically searched in those paths. That would be really nice to have.