I am giving my first steps with cocos2d-iphone
.
I am using:
CCSpriteFrameCache *frameCache = [CCSpriteFrameCache sharedSpriteFrameCache];
[frameCache addSpriteFramesWithFile:@"textures.plist"];
to use my zwoptex file. With that set, I am creating my CCSprites
using the frameCache
like this:
[CCSprite spriteWithSpriteFrameName:@"filename.png"];
So far, so good. Now I am creating my own particle system and I need to set the texture. I guess it would make sense to read from the zwoptex but I couldn't find a way to do it. I also checked the examples and they do something like:
emitter.texture = [[CCTextureCache sharedTextureCache] addImage: @"fire.pvr"];
So my questions are:
- If I am going to have more than a particle system with different textures. Should I create a zwoptext with them? If so, how?
- Why do the examples do
[[CCTextureCache sharedTextureCache] addImage: @"file"];
? it's because it's not added two times?
EDIT: I just posted this in the cocos2d's forum.