Hi!
In my game I use CCSpriteSheet (with Zwoptex) for sprites and ParticleDesigner for particle systems.
The problem is all particles ALWAYS on top. If I setup zorder 10 for sprites and 5 for particles - particles on top! :(
How to fix this?
A fast, easy to use, free, and community supported 2D game engine
Hi!
In my game I use CCSpriteSheet (with Zwoptex) for sprites and ParticleDesigner for particle systems.
The problem is all particles ALWAYS on top. If I setup zorder 10 for sprites and 5 for particles - particles on top! :(
How to fix this?
Nobody can help?
How do you add the sprites and the particles to your layer? can you post some code? I have both sprites and particles on same layer and with correct zorder and have no issues at all.
in init:
CCSpriteSheet *spriteManager = [CCSpriteSheet spriteSheetWithFile:@"mySprites.png" capacity:50];
[self addChild:spriteManager z:0 tag:kSpriteManager];
[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"mySprites.plist"];
somewhere:
CCSpriteSheet *spriteManager = (CCSpriteSheet*)[self getChildByTag:kSpriteManager];
CCSprite *background = [CCSprite spriteWithSpriteFrameName:@"GameBG.png"];
[spriteManager addChild:background z:1 tag:kBackground];
CCSprite *sprite1 = [CCSprite spriteWithSpriteFrameName:@"sprite1.png"];
[spriteManager sprite1 z:10 tag:kSprite1];
CCQuadParticleSystem *particles = [CCQuadParticleSystem particleWithFile:@"particles.plist"];
[self addChild:particles z:5];
Now I see that particles will alwas be on top since zorder of CCSpriteSheet is 0, but how can I draw particles between some sprites in CCSpriteSheet? Is it possible with just one CCSpriteSheet?
Hi,
You cant render particles in a sprite sheet, so you cant do this. I have a platforms sprite sheet, a sprites sprite sheet and then I have separate layers for my particles. One layer which renders particles below the sprites sprite sheet and one above... You may have to split your sprites across multiple sprite sheets I think.
Regards
i
You must log in to post.