粒子特效


1、自定义粒子特效

使用ParticleDesigner工具生成plist动画文件,再使用下面代码即可实现。

ParticleSystemQuad * texiao = ParticleSystemQuad::create("texiao.plist");
texiao->setPosition(Point(0,0));
this->addChild(texiao);


2、自带粒子特效(举例11种)

  1. //爆炸效果  
  2.     CCParticleSystem* particleSystem = CCParticleExplosion::create();  
  3.     particleSystem->setTexture(CCTextureCache::sharedTextureCache()->addImage("stars.png"));  
  4.     addChild(particleSystem);  
  5.       
  6.     //火焰效果  
  7.     CCParticleSystem* particleSystem = CCParticleFire::create();  
  8.     particleSystem->setTexture(CCTextureCache::sharedTextureCache()->addImage("fire.png"));  
  9.     addChild(particleSystem);  
  10.       
  11.     //花束效果  
  12.     CCParticleSystem* particleSystem = CCParticleFlower::create();  
  13.     particleSystem->setTexture(CCTextureCache::sharedTextureCache()->addImage("fire.png"));  
  14.     addChild(particleSystem);  
  15.       
  16.     //烟花效果  
  17.     CCParticleSystem* particleSystem = CCParticleFireworks::create();  
  18.     particleSystem->setTexture(CCTextureCache::sharedTextureCache()->addImage("fire.png"));  
  19.     addChild(particleSystem);  
  20.       
  21.     //星系效果  
  22.     CCParticleSystem* particleSystem = CCParticleGalaxy::create();  
  23.     particleSystem->setTexture(CCTextureCache::sharedTextureCache()->addImage("fire.png"));  
  24.     addChild(particleSystem);  
  25.   
  26.     //流星效果  
  27.     CCParticleSystem* particleSystem = CCParticleMeteor::create();  
  28.     particleSystem->setTexture(CCTextureCache::sharedTextureCache()->addImage("fire.png"));  
  29.     addChild(particleSystem);  
  30.       
  31.     //下雨效果  
  32.     CCParticleSystem* particleSystem = CCParticleRain::create();  
  33.     particleSystem->setTexture(CCTextureCache::sharedTextureCache()->addImage("fire.png"));  
  34.     addChild(particleSystem);  
  35.       
  36.     //烟雾效果  
  37.     CCParticleSystem* particleSystem = CCParticleSmoke::create();  
  38.     particleSystem->setTexture(CCTextureCache::sharedTextureCache()->addImage("fire.png"));  
  39.     addChild(particleSystem);  
  40.       
  41.     //下雪效果  
  42.     CCParticleSystem* particleSystem = CCParticleSnow::create();  
  43.     particleSystem->setTexture(CCTextureCache::sharedTextureCache()->addImage("snow.png"));  
  44.     addChild(particleSystem);  
  45.       
  46.     //漩涡效果  
  47.     CCParticleSystem* particleSystem = CCParticleSpiral::create();  
  48.     particleSystem->setTexture(CCTextureCache::sharedTextureCache()->addImage("fire.png"));  
  49.     addChild(particleSystem);  
  50.       
  51.     //太阳效果  
  52.     CCParticleSystem* particleSystem = CCParticleSun::create();  
  53.     particleSystem->setTexture(CCTextureCache::sharedTextureCache()->addImage("fire.png"));  
  54.     addChild(particleSystem);  


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值