微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

cocos2d-x 自带11种粒子特效

  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);

原文地址:https://www.jb51.cc/cocos2dx/341633.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐