Cocos2dx现成的粒子特效

Cocos2dx现成的粒子特效,第1张

概述函数 1.特效 CCParticleExplosion        //爆炸粒子特效 CCParticleFire                  //火焰粒子特效 CCParticleFlower             //花束粒子特效 CCParticleFireworks       //烟花粒子特效 CCParticleGalaxy            //星系粒子特效 CCPar

函数


1.特效

CCParticleExplosion //爆炸粒子特效

CCParticleFire //火焰粒子特效

CCParticleFlower //花束粒子特效

CCParticleFireworks //烟花粒子特效

CCParticlegalaxy //星系粒子特效

CCParticleMeteor //流星粒子特效

CCParticleRain //下雨粒子特效

CCParticleSmoke //烟雾粒子特效

CCParticleSNow //下雪粒子特效

CCParticleSpiral //漩涡粒子特效

CCParticleSun //太阳粒子特效

2.函数

setTexture();

//设置特效贴图。这里注意。老版本中如果不设置这项会报错退出。2.1.4中不设置可以使用。

setautoRemoveOnFinish(bool);

//设置自动释放true为自动释放。

setpositionType()

//设置移动类型

kCCpositionTypeFree//自由模式。粒子不予发射器联系,发射后粒子走自己的轨道,可以做出焰尾。

kCCpositionTyperelative//相对模式。粒子发射器随节点移动而移动。

kCCpositionTypeGrouped//相对模式。粒子随发射器移动而移动。

3.自定义

CCParticleSystemQuad::create();

这个函数是用来加载自定义的pList文件的。怎么自定义呢?我们使用工具“红孩儿工具箱”就能做自定义特效了。


1、先说雪花特效。
view source print ? 1. ParticleSystem* ps = ParticleSNow::create(); 2. //因为偷懒,我直接用helloWorld里的close 图片当雪花 3. ps->setTexture(Director::getInstance()->getTextureCache()->addImage("CloseSelected.png")); 4. ps->setposition(Point(200,));//生成的雪花从这个坐标往下落 5. this->addChild(ps,宋体">10); 演示效果...自己去想象吧。
如果想控制产生场景中雪花的数量,可以使用下面这个接口,下面几个例子也是一样:
staticParticleSNow* createWithTotalParticles(intnumberOfParticles);//参数即是雪花的数量 2、烟火效果
ParticleSystem* ps = ParticleFireworks::create(); )); 3、下雨效果
ParticleSystem* ps = ParticleRain::create();
4、烟雾
ParticleSystem* ps = ParticleSmoke::create();
//效果实在不咋地 5、爆炸
ParticleSystem* ps = ParticleExplosion::create();
6、螺旋
ParticleSystem* ps = ParticleSpiral::create();
7、流星(用彗星来描述会更贴切一点,因为它拖着一条长长的尾巴)
ParticleSystem* ps = ParticleMeteor::create();
8、星云
ParticleSystem* ps = Particlegalaxy::create();
9、太阳( 日 )
ParticleSystem* ps = ParticleSun::create();
10、火焰
ParticleSystem* ps = ParticleFire::create();
); 总结

以上是内存溢出为你收集整理的Cocos2dx现成的粒子特效全部内容,希望文章能够帮你解决Cocos2dx现成的粒子特效所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1059555.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-25
下一篇2022-05-25

发表评论

登录后才能评论

评论列表(0条)