zoukankan      html  css  js  c++  java
  • 对比kCCPositionTypeFree和kCCPositionTypeRelative两种粒子移动类型

    CCParticleSystem* particleSystemFree = CCParticleSun::create();
            //设置贴图
            particleSystemFree->setTexture(CCTextureCache::sharedTextureCache()->addImage("fire.png"));
            //设置自动释放 
            particleSystemFree->setAutoRemoveOnFinish(true);
            //设置类型移动类型kCCPositionTypeFree-----随着layer的移动会有拖尾的效果
            particleSystemFree->setPositionType(kCCPositionTypeFree);
            particleSystemFree->setPosition(ccp(90,160));
            addChild(particleSystemFree);
    
            CCParticleSystem* particleSystemRe1 = CCParticleSun::create();
            particleSystemRe1->setTexture(CCTextureCache::sharedTextureCache()->addImage("fire.png"));
            //设置移动类型kCCPositionTypeRelative----随着layer的移动并没有什么变化
            particleSystemRe1->setPositionType(kCCPositionTypeRelative);
            particleSystemRe1->setPosition(ccp(200,160));
            addChild(particleSystemRe1);
    
            //让当前layer来回移动,观察两个移动模式不同的粒子特效
            CCFiniteTimeAction* move = CCMoveBy::create(3,ccp(290,0));
            CCFiniteTimeAction* back = move->reverse();
            this->runAction(CCSequence::create(move,back,NULL));

  • 相关阅读:
    codevs 3657 括号序列
    洛谷P1962 斐波那契数列
    Black Rock shooter
    codevs 2596 售货员的难题
    51Nod-1154 回文串划分
    UVA
    POJ3321[苹果树] 树状数组/线段树 + dfs序
    Hdu 4578 Transformation (线段树 分类分析)
    786B
    438D
  • 原文地址:https://www.cnblogs.com/newlist/p/3124225.html
Copyright © 2011-2022 走看看