Buron
Buron

Reputation: 1233

Working with the same sprites using Cocos2d

I need some recommendations how to work better with the same sprites using Cocos2d.

How to improve application performance and memory usage having more than 10 exactly the same sprites on the screen.

The only improvement i've found is not to load them again to memory , but use something like this CCSprite *newSprite = [CCSprite spriteWithTexture:[oldSprite texture]];

Upvotes: 0

Views: 855

Answers (1)

Bongeh
Bongeh

Reputation: 2300

I recommend you use CCBatchnode, you can load just 1 image into texture memory and reuse it.

http://www.raywenderlich.com/1271/how-to-use-animations-and-sprite-sheets-in-cocos2d

Ray has a great tutorial here explaining spritesheets.

Upvotes: 2

Related Questions