My app gets some resources, specifically .pvr.ccz, from URL and save them in Documents directory.
NSString *documentsDirectoryPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
...
[responseObject writeToFile:[documentsDirectoryPath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.%@", <file_name>, @"pvr.ccz"]] options:NSAtomicWrite error:nil];
After that creates a sprite using .plist and .pvr.ccz. The list of .png images specified in the property list which is already in the project.
[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"<property_list_name>.plist"];
CCSprite *sprite = [CCSprite spriteWithSpriteFrameName:[NSString stringWithFormat:@"<file_name>.png"]];
This will be warned that -[CCFileUtils fullPathFromRelativePath:resolutionType:] : cocos2d: Warning: File not found: <file_name>.pvr.ccz
Is there any way to make Cocos2D can search the resources from URL that saved in a specific folder? or is there any way to save the resources from URL in the place where Cocos2D can found them?
I believe that if you specify a full path to coco’s it will look there. Thus
have not tried this, but it should work.
EDIT : assumes .plist is in the project, but the .pvr.ccz is in documents dictionary. Assuming further that your texture is called “downloaded-hd.pvr.ccz”, the project enables HD for devices, the following example should find your files:
i think the -hd will be silently processed correctly.