0

I want to use a full color PNG image as a particle in cocos2d with an emitter designed in ParticleDesigner.

I dragged in the image I want to use and set-up everything how I want it in ParticleDesigner and it looks good.

Problem is when I import into cocos2d, the particles appear to have grey squares over them (a small bit of the yellow image is visible on the side, but they gray covers the rest including transparent areas).

Code:

CCParticleSystemQuad* particleSystem = [CCParticleSystemQuad particleWithFile:@"coin magnet.plist"];
particleSystem.position = ccp(320, 320-16);
[self addChild:particleSystem z:1000];

I'm guessing it might be an issue with blending options...

I've tried GL_SRC_ALPHA to GL_SRC_MINUS_ALPHA (set by the normal button in ParticleDesigner), additive combinations, and trying different things with GL_ZERO and GL_ONE

Why are the particles appearing grey? Does cocos2d support using full color images as particles?

Dustin
  • 94
  • 1
  • 3
  • I don't remember exactly if this is still true, but you were required to use only square images using a power of two dimension (ie 16x16, 64x64, 256x256). – CodeSmile May 31 '12 at 17:33
  • Yep still true, particles images must have square dimensions at a power of two. 16x16 color PNG is working for me. (15x15 didn't show up at all) – Dustin Jun 01 '12 at 04:29

1 Answers1

0

Figured it out!

Turns out the image didn't embed properly in the plist (bug in ParticleDesigner) so that's why it was appearing grey.

Exporting with the png separate solved the issue.

And yes, you can definitely use color images as particles in cocos2d!

Dustin
  • 94
  • 1
  • 3