• 特效effects(二)


    CCActionInterval* createEffect(int nIndex, float t)
    {
    
        CCDirector::sharedDirector()->setDepthTest(false);
    
        switch(nIndex)
        {
            case 0: return Shaky3DDemo::create(t);
            case 1: return Waves3DDemo::create(t);
            case 2: return FlipX3DDemo::create(t);
            case 3: return FlipY3DDemo::create(t);
            case 4: return Lens3DDemo::create(t);
            case 5: return Ripple3DDemo::create(t);
            case 6: return LiquidDemo::create(t);
            case 7: return WavesDemo::create(t);
            case 8: return TwirlDemo::create(t);
            case 9: return ShakyTiles3DDemo::create(t);
            case 10: return ShatteredTiles3DDemo::create(t);
            case 11: return ShuffleTilesDemo::create(t);
            case 12: return FadeOutTRTilesDemo::create(t);
            case 13: return FadeOutBLTilesDemo::create(t);
            case 14: return FadeOutUpTilesDemo::create(t);
            case 15: return FadeOutDownTilesDemo::create(t);
            case 16: return TurnOffTilesDemo::create(t);
            case 17: return WavesTiles3DDemo::create(t);
            case 18: return JumpTiles3DDemo::create(t);
            case 19: return SplitRowsDemo::create(t);
            case 20: return SplitColsDemo::create(t);
            case 21: return PageTurn3DDemo::create(t);
        }
    
        return NULL;
    }
    CCActionInterval* getAction()
    {
        CCActionInterval* pEffect = createEffect(actionIdx, 3);
    
        return pEffect;
    } 
    //创建一个新的节点
        CCNode* node = CCNode::create();
        CCActionInterval* effect = getAction();
    //通过该节点执行动作
        node->runAction(effect);
    //将该节点添加进去
        addChild(node, 0, kTagBackground);
        
        CCSprite *bg = CCSprite::create(s_back3);
    //将精灵添加到节点当中,这样添加进去的精灵也会随着结点一起动作
        node->addChild(bg, 0);
  • 相关阅读:
    Maganto错误Cannot initialize the indexer process的解决方法
    保护单元格内容
    欧几里得算法
    SVN服务端命令行的使用心得
    C++常用数值类型的值范围的宏定义
    代码之谜(三) 运算符
    《越狱》观后感
    R 报错的问题
    代码之谜(二) 语句与表达式
    你为什么薪水那么低(二)之 生产力
  • 原文地址:https://www.cnblogs.com/newlist/p/3208468.html
Copyright © 2020-2023  润新知