加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

cocos2d-x 自带11种粒子特效

发布时间:2020-12-14 16:27:40 所属栏目:百科 来源:网络整理
导读:[cpp] view plain copy //粒子特效 //爆炸效果 CCParticleSystem*particleSystem=CCParticleExplosion::create(); particleSystem-setTexture(CCTextureCache::sharedTextureCache()-addImage( "stars.png" )); addChild(particleSystem); //火焰效果 CCPart
[cpp] view plain copy
  1. //粒子特效
  2. //爆炸效果
  3. CCParticleSystem*particleSystem=CCParticleExplosion::create();
  4. particleSystem->setTexture(CCTextureCache::sharedTextureCache()->addImage("stars.png"));
  5. addChild(particleSystem);
  6. //火焰效果
  7. CCParticleSystem*particleSystem=CCParticleFire::create();
  8. particleSystem->setTexture(CCTextureCache::sharedTextureCache()->addImage("fire.png"));
  9. addChild(particleSystem);
  10. //花束效果
  11. CCParticleSystem*particleSystem=CCParticleFlower::create();
  12. particleSystem->setTexture(CCTextureCache::sharedTextureCache()->addImage("fire.png"));
  13. //烟花效果
  14. CCParticleSystem*particleSystem=CCParticleFireworks::create();
  15. //星系效果
  16. CCParticleSystem*particleSystem=CCParticleGalaxy::create();
  17. //流星效果
  18. CCParticleSystem*particleSystem=CCParticleMeteor::create();
  19. //下雨效果
  20. CCParticleSystem*particleSystem=CCParticleRain::create();
  21. //烟雾效果
  22. CCParticleSystem*particleSystem=CCParticleSmoke::create();
  23. //下雪效果
  24. CCParticleSystem*particleSystem=CCParticleSnow::create();
  25. particleSystem->setTexture(CCTextureCache::sharedTextureCache()->addImage("snow.png"));
  26. //漩涡效果
  27. CCParticleSystem*particleSystem=CCParticleSpiral::create();
  28. //太阳效果
  29. CCParticleSystem*particleSystem=CCParticleSun::create();
  30. addChild(particleSystem);

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读