I want to draw some sprites in the screen, using CCSprite in cocos2d. But if I init each CCSprites with [MySprite spriteWithFile:@"MyImage.png"],and each sprite only use part of the image, will the image be loaded into memory many times? As memory resource is very limited and the size of the image is big(1024*1024), is there anyway to make sure the image is loaded only once? And how to init the CCSprite开发者_如何转开发s so as to make each sprites be part of the image?
Yes there actually is. You cached your spritesheet, correct? This newer method of loading sprites does just that, by them being cached you don't have to worry about multiple sprites weighing heavily on your resources.
精彩评论