Load images(sprites) from zip archive

Load images(sprites) from zip archive
0.0 0


Hello. I’m wonder if there is a correct way to load sprite or images from zip archive?
For now i’m thinking to pass the data over the texture.

CCTexture2D * texture = new CCTexture2D();
const char * tdata = CCFileUtils::getFileDataFromZip(resname, imagename, &pSize);
texture->initWithData(tdata, CCTexture2DPixelFormat, width, height, CCSizeMake(width, height));
CCSprite * sprite = CCSprite::spriteWithTexture(texture);

But it seems to be a little confusing. Is there a more beautiful solution? :slight_smile:


We must keep the balance between convient and smart, isn’t it?


Sure. Thanks for response.