//粒子编辑器
//初始化粒子个数
auto TestParticle = ParticleSystemQuad::createWithTotalParticles(289);
//设置粒子纹理图片
TestParticle->setTexture(TextureCache::getInstance()->addImage("smoke.png"));
//设置混合模式主要设置src和dst参数
ccBlendFunc blend;
blend.src = GL_DST_ALPHA;
blend.dst = GL_ONE;
TestParticle->setBlendFunc(blend);
//设置开始时候的粒子大小以及偏差
TestParticle->setStartSize(111);
TestParticle->setStartSizeVar(10);
//设置粒子结束时候大小以及偏差
TestParticle->setEndSize(40.0f);
TestParticle->setEndSizeVar(0);
//粒子自身旋转
TestParticle->setStartSpin(720);
TestParticle->setStartSpinVar(683);
TestParticle->setEndSpin(0);
TestParticle->setEndSpinVar(0);
//设置开始时候的颜色以及偏差
TestParticle->setStartColor(Color4F(1, 0.4, 0.69, 1));
TestParticle->setStartColorVar(Color4F(0, 0, 0.2, 0.1));
//设置结束时候的颜色以及偏差
TestParticle->setEndColor(Color4F(0, 0, 0, 1));
TestParticle->setEndColorVar(Colo
Cocos2d 粒子系统对应 EffectHub Cocos2dx 特效编辑器 可以直接在项目中使用的参数模板
于 2019-07-24 16:44:29 首次发布