0

I have a Particle designer plist in Cocos2d that plays ok when I use plist that "loops" or repeats itself e.g. a rainbow but does not display when single display e.g. an explosion.

I'm using cocos2d 2.0 in a vanilla template with a plists created in Particle Designer tool.

I'm using following code with iOS 5.1... am I missing something?

-(void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

CCParticleSystemQuad *particle = [CCParticleSystemQuad particleWithFile:@"explosion.plist"]; //alt plist working with rainbow.plist
        particle.position = ccp(240,160);
        [self addChild:particle z:20];
        particle.autoRemoveOnFinish = YES;
JimZ
  • 147
  • 1
  • 8

2 Answers2

0

Have you verified that the touch event is firing?

One thing that snagged me early on with particle designer, is that the position you set does indeed matter for particle systems that have a width and height. It is quite possible that your particle system is positioned way off screen depending on how you set it up. Try changing the x and y in the plist file to 0 and 0, and see if that helps.

The one last thing I might try is turning the zOrder to 99999.

dqhendricks
  • 19,030
  • 11
  • 50
  • 83
  • Thank you for your suggestions, but these were checked and I tried the z order with no luck. Under original setup I was able to get one explosion working from public shared ones called "Small Explosion" where as one called "Large explosion" does not work. Likely something to do with particle plist settings (?) but its not clear why one works and the other does not given used in same project e.g. I just change the plist name string. – JimZ Feb 08 '13 at 02:52
  • @dqhendriicks Thank again! I have posted a way to get it work even though I don't really understand the workings of the blend stuff. – JimZ Feb 12 '13 at 01:38
0

It seems it has to do with the blend function, which I don't understand (Bottom right corner of config screen). For benefit of others, while I don't have a low level explanation other than to suggest changing these to GL_ONE made it visible. Can't assume that because it displays in the PD simulator that it shows on device.

JimZ
  • 147
  • 1
  • 8