2014年2月10日 星期一

cocos2d-x 22種特效

http://rritw.com/a/caozuoxitong/OS/20130521/355977.html


CCSprite* sp = CCSprite::create("Default.png");     sp->setPosition(ccp(240

CCSprite* sp = CCSprite::create("Default.png");
    sp->setPosition(ccp(240, 160));
    addChild(sp);
    
    //常見的22種特效
    
    //3D晃動的特效
//    CCActionInterval* shaky3D = CCShaky3D::create(5, CCSize(10, 10), 15, false);
//    sp->runAction(shaky3D);


    //3D瓷磚晃動特效
//    CCActionInterval* shakyTiles3D = CCShakyTiles3D::create(5, CCSize(10, 10), 5, false);
//    sp->runAction(shakyTiles3D);
    
    //波動特效
//    CCActionInterval* waves = CCWaves::create(5, CCSize(10, 10), 10, 20, true, true);
//    sp->runAction(waves);
    
    //3D波動特效
//    CCActionInterval* waves3D = CCWaves3D::create(5, CCSize(10, 10), 10, 20);
//    sp->runAction(waves3D);
    
    //3D瓷磚波動特效
//    CCActionInterval* wavesTiles3D = CCWavesTiles3D::create(5, CCSize(10, 10), 10, 20);
//    sp->runAction(wavesTiles3D);


    //X軸 3D反轉特效
//    CCActionInterval* filpX = CCFlipX3D::create(5);
//    sp->runAction(filpX);
    
    //Y軸3D反轉特效
//    CCActionInterval* filpY = CCFlipY3D::create(5);
//    sp->runAction(filpY);


    //凸透鏡特效
//    CCActionInterval* lens = CCLens3D::create(2, CCSize(10, 10),CCPointMake(240, 160), 240);
//    sp->runAction(lens);
    
    //水波紋特效
//    CCActionInterval* ripple = CCRipple3D::create(5, CCSize(10, 10), CCPointMake(240, 160), 240, 4, 160);
//    sp->runAction(ripple);
    
    //液體特效
//    CCActionInterval* liquid = CCLiquid::create(5, CCSize(10, 10), 4, 20);
//    sp->runAction(liquid);
    
    //扭曲旋轉特效
//    CCActionInterval* twirl = CCTwirl::create(50, CCSize(10, 10), CCPointMake(240, 160), 2, 2.5);
//    sp->runAction(twirl);
    
    //破碎的3D瓷磚特效
//    CCActionInterval* shatteredTiles = CCShatteredTiles3D::create(15, CCSize(10, 10), 50, true);
//    sp->runAction(shatteredTiles);
    
    //瓷磚洗牌特效
//    CCActionInterval* shuffle = CCShuffleTiles::create(5, CCSize(50, 50), 50);
//    sp->runAction(shuffle);
    
    //部落格效果,從左下角到右上角
//    CCActionInterval* fadeOutTRTiles = CCFadeOutTRTiles::create(5, CCSize(50, 50));
//    sp->runAction(fadeOutTRTiles);
    
    //部落格效果,從右上角到左下角
//    CCActionInterval* fadeOutBLTiles  = CCFadeOutBLTiles::create(5, CCSize(50, 50));
//    sp->runAction(fadeOutBLTiles);
    
    //折叠效果 從下到上
//    CCActionInterval* fadeOutUpTiles = CCFadeOutUpTiles::create(5, CCSize(10, 10));
//    sp->runAction(fadeOutUpTiles);
    
    //折叠效果,從上到下
//    CCActionInterval* fadeOutDownTiles = CCFadeOutDownTiles::create(4, CCSize(20, 50));
//    sp->runAction(fadeOutDownTiles);
    
    //方塊消失特效
//    CCActionInterval* turnOffFiels = CCTurnOffTiles::create(4, CCSize(50, 50));
//    sp->runAction(turnOffFiels);
    
    //跳動的方塊特效
//    CCActionInterval* jumpTiles = CCJumpTiles3D::create(5, CCSize(20, 20), 5, 20);
//    sp->runAction(jumpTiles);
    
    //分多行消失特效
//    CCActionInterval* splitCols = CCSplitCols::create(5, 50);
//    sp->runAction(splitCols);
    
    //分多列消失特效
//    CCActionInterval* splitRows = CCSplitRows::create(5, 50);
//    sp->runAction(splitRows);
    
    //3D翻頁特效
    CCActionInterval* pageTurn3D = CCPageTurn3D::create(4, CCSize(20, 20));
    sp->runAction(pageTurn3D);