0
votes

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 CCSprites so as to make each sprites be part of the image?

1

1 Answers

0
votes

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.