Game Development Reference
In-Depth Information
-(void) runEffect
{
. . .
switch (particleType)
{
. . .
case ParticleTypeDesignedFX:
system = [CCParticleSystemQuad particleWithFile:@"fx1.plist"];
break;
case ParticleTypeDesignedFX2:
system = [CCParticleSystemQuad particleWithFile:@"fx2.plist"];
system.positionType = kCCPositionTypeFree;
break;
case ParticleTypeSelfMade:
system = [ParticleEffectSelfMade node];
break;
default:
// do nothing
break;
}
. . .
}
You initialize a CCParticleSystem with a Particle Designer effect by using the
particleWithFile method and providing the particle effect's plist file as paramet-
er. In this case, I chose the CCParticleSystemQuad since it is faster than
CCParticleSystem and can be batched with CCParticleBatchNode . Most
importantly, Particle Designer effects require the quad particle system because
CCParticleSystem isn't compatible with effects created with Particle Designer.
Sharing Particle Effects
Search Nedrilad ::




Custom Search