I want show particle effect in my app, but problem is when I add particles on the view it shows particle image of different colors, I don't want any color effect on the particle images I am using. Please help me!!
THANX !!!
Thanks Calvin Fan! It work for me fine!! Here is my code:
CCParticleExplosion *drops = [[CCParticleExplosion alloc] initWithTotalParticles:3000];
drops.texture = [[CCTextureCache sharedTextureCache] addImage:@"p1-dust-l.png"];
drops.position = position;
drops.life =0.2;
drops.duration = 0.5;
drops.scale = 0.5;
drops.speed = 100;
ccColor4F startColor, startColorVar, endColor, endColorVar;
startColor.r = 1.0f;
startColor.g = 1.0f;
startColor.b = 1.0f;
startColor.a = 1.0f;
startColorVar.r = 0.0f;
startColorVar.g = 0.0f;
startColorVar.b = 0.0f;
startColorVar.a = 0.0f;
endColor.r = 1.0f;
endColor.g = 1.0f;
endColor.b = 1.0f;
endColor.a = 1.0f;
endColorVar.r = 0.0f;
endColorVar.g = 0.0f;
endColorVar.b = 0.0f;
endColorVar.a = 0.0f;
drops.startColor = startColor;
drops.startColorVar = startColorVar;
drops.endColor = endColor;
drops.endColorVar = endColorVar;
drops.autoRemoveOnFinish = YES;
CCParticleExplosion *myEmitter; myEmitter = [[CCParticleExplosion alloc] initWithTotalParticles:30]; //star.png is my particle image myEmitter.texture = [[CCTextureCache sharedTextureCache] addImage:@"star.png"]; myEmitter.position = ccp(250,s250); myEmitter.life =0.2; myEmitter.duration = 0.5; myEmitter.scale = 0.5; myEmitter.speed = 100; //For not showing color myEmitter.blendAdditive = NO; [self myEmitter z:50]; myEmitter.autoRemoveOnFinish = YES;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With