//plist文件中面有粒子效果的各种參数
//textureFileName相应着使用粒子的图片
auto particle = ParticleSystemQuad::create("starFlash.plist");
particle->setPosition(Vec2(s.width / 2, s.height / 2));
addChild(particle); //全部的配置也能够自己写
auto p2 = ParticleSystemQuad::createWithTotalParticles(200);
p2->setTexture(Director::getInstance()->getTextureCache()->addImage("CloseNormal.png"));
p2->setPosition(Vec2(100, 100));
// duration
p2->setDuration(ParticleSystem::DURATION_INFINITY); // radius mode
p2->setEmitterMode(ParticleSystem::Mode::RADIUS); // radius mode: start and end radius in pixels
p2->setStartRadius(4);
p2->setStartRadiusVar(1);
p2->setEndRadius(ParticleSystem::START_RADIUS_EQUAL_TO_END_RADIUS);
p2->setEndRadiusVar(0); // radius mode: degrees per second
p2->setRotatePerSecond(100);
p2->setRotatePerSecondVar(0); // angle
p2->setAngle(90);
p2->setAngleVar(0); // emitter position
auto size = Director::getInstance()->getWinSize();
p2->setPosVar(Point::ZERO); // life of particles
p2->setLife(0.5);
p2->setLifeVar(0); // spin of particles
p2->setStartSpin(0);
p2->setStartSpinVar(0);
p2->setEndSpin(0);
p2->setEndSpinVar(0); // color of particles
Color4F startColor(0.0f, 0.8f, 0.9f, 1.0f);
p2->setStartColor(startColor); Color4F startColorVar(0, 0, 0, 1.0f);
p2->setStartColorVar(startColorVar); Color4F endColor(1.0f, 1.0f, 1.0f, 0.1f);
p2->setEndColor(endColor); Color4F endColorVar(0, 0, 0, 0.1f);
p2->setEndColorVar(endColorVar); // size, in pixels
p2->setStartSize(20);
p2->setStartSizeVar(1);
p2->setEndSize(0); // emits per second
p2->setEmissionRate(p2->getTotalParticles() / p2->getLife()); // additive
p2->setBlendAdditive(false); //addChild(p2);
p2->setPosition(Point(200,200));
addChild(p2);

最新文章

  1. Qt类继承图
  2. SAP ECC FI配置文档
  3. Linux 网络编程八(epoll应用--大并发处理)
  4. CocoStudio UI 编辑器的使用
  5. InvocationHandler
  6. Unable to execute dex: method ID not in [0, 0xffff]: 65536
  7. qml实现自定义标题栏按钮
  8. hrbustoj 2033 A Funny Game(对称博弈)
  9. 小程序基于疼讯qcloud的nodejs开发服务器部署
  10. Html转义字符列表
  11. go项目
  12. Spring框架之使用JdbcTemplate开发Dao层程序
  13. Bootstrap3基础 caret 辅助类样式 下拉的小三角
  14. Householder矩阵,Givens矩阵
  15. Delphi: Class Static Methods
  16. jQuery实现radio第一次点击选中第二次点击取消功能(转)
  17. 【Loadrunner】通过loadrunner录制时候有事件但是白页无法出来登录页怎么办?
  18. 《算法竞赛进阶指南》0x10 基本数据结构 Hash
  19. C/C++语言中让电脑随机的在某个范围中的任一随机数
  20. EMQ 注意事项

热门文章

  1. (转)Vuex简单入门
  2. Python Base of Scientific Stack(Python基础之科学栈)
  3. html5——背景
  4. day12-闭包函数、装饰器
  5. Linux cat 命令
  6. Free中的buffer和cache理解
  7. Bullet:Python的函数中参数是引用吗?
  8. 思维风暴 codeforces (1060A) Phone Numbers
  9. Linux之日志管理
  10. IO相关操作