//不使用 CCParticleBatchNode : 注意比较 左下角的显示信息
for(int i=; i<; ++i)
{
CCParticleSystem* particleSystem = CCParticleSun::create();
particleSystem->setTexture(CCTextureCache::sharedTextureCache()->addImage("fire.png"));
particleSystem->setPosition(ccp(+i*,));
addChild(particleSystem);
}

//使用 CCParticleBatchNode : 注意比较 左下角的显示信息
CCTexture2D* texture = CCTextureCache::sharedTextureCache()->addImage("fire.png");
CCParticleBatchNode* particleNode = CCParticleBatchNode::createWithTexture(texture);
for(int i=; i<; ++i)
{
CCParticleSystem* particleSystem = CCParticleSun::create();
particleSystem->setTexture(CCTextureCache::sharedTextureCache()->addImage("fire.png"));
particleSystem->setPosition(ccp(+i*,));
particleNode->addChild(particleSystem);
}
addChild(particleNode);

//CCParallaxNode  使用 远景 中景 近景 的移动效果

CCSprite* spFront = CCSprite::create("cocos2dbanner.png");
CCSprite* spMiddle = CCSprite::create("HelloWorld.png");
CCSprite* spFar = CCSprite::create("background.png"); CCParallaxNode* parallaxNode = CCParallaxNode::create();
addChild(parallaxNode); //近景
parallaxNode->addChild(spFront,,ccp(4.8f,),ccp(spFront->getContentSize().width/,spFront->getContentSize().height/)); //中景
parallaxNode->addChild(spMiddle,,ccp(1.2f,),ccp(spMiddle->getContentSize().width/,spMiddle->getContentSize().height/+spFront->getContentSize().height/)); //远景
parallaxNode->addChild(spFar,,ccp(0.5f,),ccp(spFar->getContentSize().width/,spFar->getContentSize().height/+spFront->getContentSize().height/+spMiddle->getContentSize().height/)); CCActionInterval* go = CCMoveBy::create(,ccp(-,));
CCActionInterval* goBack = go->reverse();
CCFiniteTimeAction* seq = CCSequence::create(go,goBack,NULL);
parallaxNode->runAction(CCRepeatForever::create((CCActionInterval*)seq));

效果图如下:(无动画效果图片 , 想看效果就必须自己动手了 )

最新文章

  1. Ubuntu: ImportError: No module named xgboost
  2. 使用spring提供的LocalSessionFactoryBean来得到SessionFactory
  3. 【CSU 1556】Pseudoprime numbers
  4. HTML5每日一练之视频标签的应用
  5. php-PHP试题
  6. Sharepoint的网页(Page),网页解析(Parsing)与解析安全处理(Security)
  7. 精通 Oracle+Python,第 9 部分:Jython 和 IronPython — 在 Python 中使用 JDBC 和 ODP.NET
  8. 关于 iOS socket 都在这里了
  9. 【二分查找+优化O(n)】【续UVA1121】Subsequence
  10. Pygame制作微信打飞机游戏PC版
  11. React Native技术做的一个项目“微笑阅读”
  12. linux 下CentOS 下 npm命令安装gitbook失败的问题
  13. 7.app和app后端的通讯
  14. Java读取excel表,getPhysicalNumberOfCells()和getLastCellNum区别
  15. 使用mybatis plus 操作数据库
  16. Fence Repair POJ - 3253 哈夫曼思想 优先队列
  17. Oracle数据库中遇到的坑
  18. FZU2259 : 图
  19. iOS html5使用缓存并及时更新方案总结
  20. SMTP服务器设置

热门文章

  1. 信号量semaphore解析
  2. 关于ES6的let,const与var之间的三生三世
  3. Android拍照后更新相册
  4. CSS改变字体下划线颜色
  5. 杭电OJ(HDU)-ACMSteps-Chapter Three-《FatMouse&amp;#39; Trade》《今年暑假不AC》《排名》《开门人和关门人》
  6. spring bean的scope
  7. CSS中设置div垂直居中
  8. HBase核心技术点
  9. 洛谷 1641 [SCOI2010]生成字符串
  10. 升级pip3后出现importerror:cannot import name main