Search more then 1 Directory for Texture?


#1

I’m loading a texture via CCSpriteFrameCache->addSpriteFramesWithFile and would like to search both the bundle and documents directory in iOS for the texture file. Will I have to modify the cocos2dx CCFileUtils lib to do this or can i just try to load with path one and then try to load with path 2 and one of them will fail?

Thanks
ML


#2

If the path is an absolute path, it will load from the specified path.
Such as

CCSpriteFrameCache->addSpriteFramesWithFile("/xxx/yyy/zzz")

Then it will load the file from /xxx/yyy/zzz, take care of the path.


#3

But if it fails from loading from the path i provide will it then try to load from the resources that are part of the bundle?


#4

No, the path are different. For example, the parameter is /xxx/yyy/zzz, how to map to the path of bundle?