Cocos2d-x中内置了若干粒子效果,下面对每一个粒子效果进行简单的介绍:
烟雾粒子效果:
auto part= ParticleSmoke::create();
part->setPosition(Vec2(visibleSize.width/2, visibleSize.height/2));
this->addChild(part);
爆炸粒子效果:
auto part= ParticleExplosion::create();
part->setPosition(Vec2(visibleSize.width/2, visibleSize.height/2));
this->addChild(part);
烟花爆炸粒子效果:
auto part= ParticleFireworks::create();
part->setPosition(Vec2(visibleSize.width/2, visibleSize.height/2));
this->addChild(part);
下雨粒子效果:
auto part= ParticleRain::create();
part->setPosition(Vec2(visibleSize.width/2, visibleSize.height/2));
this->addChild(part);
流星粒子效果:
auto part= ParticleMeteor::create();
part->setPosition(Vec2(visibleSize.width/2, visibleSize.height/2));
this->addChild(part);
火焰粒子效果:
auto part= ParticleFire::create();
part->setPosition(Vec2(visibleSize.width/2, visibleSize.height/2));
this->addChild(part);
花束粒子效果:
auto part= ParticleFlower::create();
part->setPosition(Vec2(visibleSize.width/2, visibleSize.height/2));
this->addChild(part);
星系粒子效果:
auto part= ParticleGalaxy::create();
part->setPosition(Vec2(visibleSize.width/2, visibleSize.height/2));
this->addChild(part);
漩涡粒子效果:
auto part= ParticleSpiral::create();
part->setPosition(Vec2(visibleSize.width/2, visibleSize.height/2));
this->addChild(part);
雪花粒子效果:
auto part= ParticleSnow::create();
part->setPosition(Vec2(visibleSize.width/2, visibleSize.height/2));
this->addChild(part);
太阳粒子效果:
auto part= ParticleSun::create();
part->setPosition(Vec2(visibleSize.width/2, visibleSize.height/2));
this->addChild(part);
auto partPlist=ParticleSystem::create("xxxxx.plist");
partPlist->setBlendAdditive(true);
partPlist->setPosition(Vec2::ZERO);
this->addChild(partPlist);