3.CCFadeOutTRTiles,部落格效果,跳动的方块特效,3D瓷砖晃动特效,破碎的3D瓷砖特效,瓷砖洗牌特效,分多行消失特效,分多列消失特效-阿里云开发者社区

开发者社区> 云计算> 正文
登录阅读全文

3.CCFadeOutTRTiles,部落格效果,跳动的方块特效,3D瓷砖晃动特效,破碎的3D瓷砖特效,瓷砖洗牌特效,分多行消失特效,分多列消失特效

简介:  1 TiledGrid3D //TiledGrid3D //CCFadeOutTRTiles * action = CCFadeOutTRTiles::create(2, CCSize(20,20)); //CCFadeOutBLTiles * action = CCFadeOutBLTiles::create(2, CCSi


1 TiledGrid3D

//TiledGrid3D

//CCFadeOutTRTiles * action = CCFadeOutTRTiles::create(2,

CCSize(20,20));

//CCFadeOutBLTiles * action = CCFadeOutBLTiles::create(2,

CCSize(20,20));

//CCJumpTiles3D * action = CCJumpTiles3D::create(2,

CCSize(4,4),20,20);

//CCShakyTiles3D * action = CCShakyTiles3D::create(2, CCSize(20,

20), 30, false);

//CCShatteredTiles3D * action = CCShatteredTiles3D::create(2,

CCSize(20,20),20,false);

//CCShuffleTiles * action = CCShuffleTiles::create(2,

CCSize(20,20),2);

//CCSplitCols * action = CCSplitCols::create(2, 20);

//CCSplitRows * action = CCSplitRows::create(2, 20);

//CCTurnOffTiles * action = CCTurnOffTiles::create(2,

CCSize(20,20));

CCWavesTiles3D * action = CCWavesTiles3D::create(2,

CCSize(20,20),20,30);

spr->runAction(action);

 

部落网格效果,从左下角到右下角

CCActionInterval* fadeOutTRTiles = CCFadeOutTRTiles::create(5, CCSize(50, 50));

sp->runAction(fadeOutTRTiles);

//参数1:特效持续的时间

//参数2:网格大小

#include "T18Grid3D.h"

#include "AppMacros.h"

 

CCScene *T18Grid3D::scene()

{

    CCScene * scene = CCScene::create();

    T18Grid3D * layer = T18Grid3D::create();

    scene->addChild(layer);

    return scene;

}

 

bool T18Grid3D::init()

{

    TBack::init();

   

    //Grid3D

    CCSprite * spr = CCSprite::create("HelloWorld.png");

    spr->setPosition(ccp(winSize.width / 2, winSize.height / 2));

    addChild(spr);

 

    CCFadeOutTRTiles * action = CCFadeOutTRTiles::create(

        20,

        CCSize(20, 20));

 

    spr->runAction(action);

 

    return true;

}

运行结果:

跳动的方块特效

CCActionInterval* jumpTitles = CCJumpTitles3D::create(5,CCSize(20,20),5,20);

sp->runAction(jumpTiles);

作用:跳动的方格特效

参数1:特效持续的时间

参数2:网格的大小

参数3:跳动的次数

参数4:跳动的振幅

#include "T18Grid3D.h"

#include "AppMacros.h"

 

CCScene *T18Grid3D::scene()

{

    CCScene * scene = CCScene::create();

    T18Grid3D * layer = T18Grid3D::create();

    scene->addChild(layer);

    return scene;

}

 

bool T18Grid3D::init()

{

    TBack::init();

   

    //Grid3D

    CCSprite * spr = CCSprite::create("HelloWorld.png");

    spr->setPosition(ccp(winSize.width / 2, winSize.height / 2));

    addChild(spr);

 

    CCActionInterval* jumpTiles = CCJumpTiles3D::create(

        5,              //特效持续的时间

        CCSize(20,20),  //网格的大小

        5,              //跳动的次数

        20);            //跳动的振幅

 

    spr->runAction(jumpTiles);

 

    return true;

}

3D 瓷砖晃动特效

CCActionInterval* shakyTiles3D = CCShakyTiles3D::create(5, CCSize(10, 10), 5, false);

sp->runAction(shakyTiles3D);

作用:创建一个3d瓷砖晃动的特效

参数1:特效持续的时间

参数2:网格大小

参数3:晃动的范围

参数5:是否有z轴晃动

#include "T18Grid3D.h"

#include "AppMacros.h"

 

CCScene *T18Grid3D::scene()

{

    CCScene * scene = CCScene::create();

    T18Grid3D * layer = T18Grid3D::create();

    scene->addChild(layer);

    return scene;

}

 

bool T18Grid3D::init()

{

    TBack::init();

   

    //Grid3D

    CCSprite * spr = CCSprite::create("HelloWorld.png");

    spr->setPosition(ccp(winSize.width / 2, winSize.height / 2));

    addChild(spr);

 

    CCActionInterval* shakyTiles3D = CCShakyTiles3D::create(

        5,                //特效持续的时间

        CCSize(10, 10),   //网格大小

        5,                //晃动的范围

        false);           //是否有z轴晃动

 

    spr->runAction(shakyTiles3D);

 

    return true;

}

运行结果:

破碎的3D瓷砖特效 

CCActionInterval* shatteredTiles = CCShatteredTiles3D::create(15, CCSize(10, 10), 50, true); 

sp->runAction(shatteredTiles); 

作用:破碎的3D瓷砖特效

参数1:特效持续的时间

参数2:网格大小

参数3:范围

参数4:是否开启z

#include "T18Grid3D.h"

#include "AppMacros.h"

 

CCScene *T18Grid3D::scene()

{

    CCScene * scene = CCScene::create();

    T18Grid3D * layer = T18Grid3D::create();

    scene->addChild(layer);

    return scene;

}

 

bool T18Grid3D::init()

{

    TBack::init();

   

    //Grid3D

    CCSprite * spr = CCSprite::create("HelloWorld.png");

    spr->setPosition(ccp(winSize.width / 2, winSize.height / 2));

    addChild(spr);

 

    CCActionInterval* shatteredTiles = CCShatteredTiles3D::create(

        15,                  //特效持续的时间

        CCSize(10,10),       //网格大小

        50,                  //范围

        true);               //是否开启z

 

    spr->runAction(shatteredTiles);

 

    return true;

}

运行结果(特点是破碎的状态):

瓷砖洗牌特效:

CCActionInterval* shuffle = CCShuffleTiles::create(5, CCSize(50, 50), 50);

作用:瓷砖的洗牌特效

参数1:特效持续的时间

参数2:网格大小

参数3:随机数

#include "T18Grid3D.h"

#include "AppMacros.h"

 

CCScene *T18Grid3D::scene()

{

    CCScene * scene = CCScene::create();

    T18Grid3D * layer = T18Grid3D::create();

    scene->addChild(layer);

    return scene;

}

 

bool T18Grid3D::init()

{

    TBack::init();

   

    //Grid3D

    CCSprite * spr = CCSprite::create("HelloWorld.png");

    spr->setPosition(ccp(winSize.width / 2, winSize.height / 2));

    addChild(spr);

 

    CCActionInterval * shuffle = CCShuffleTiles::create(

        5,                //特效的持续时间

        CCSize(50,50),    //网格的大小

        50);              //随机数

 

    spr->runAction(shuffle);

 

    return true;

}

运行效果:

分多行消失特效

CCActionInterval* splitCols = CCSplitCols::create(5,50);

sp->runAction(splitCols);

作用:分多列消失特效

参数1:特效持续的时间

参数2:列数

#include "T18Grid3D.h"

#include "AppMacros.h"

 

CCScene *T18Grid3D::scene()

{

    CCScene * scene = CCScene::create();

    T18Grid3D * layer = T18Grid3D::create();

    scene->addChild(layer);

    return scene;

}

 

bool T18Grid3D::init()

{

    TBack::init();

   

    //Grid3D

    CCSprite * spr = CCSprite::create("HelloWorld.png");

    spr->setPosition(ccp(winSize.width / 2, winSize.height / 2));

    addChild(spr);

 

    CCActionInterval * splitCols = CCSplitCols::create(5,20);

 

    spr->runAction(splitCols);

 

    return true;

}

运行效果:

分多列消失特效 

CCActionInterval* splitRows = CCSplitRows::create(5, 50); 

sp->runAction(splitRows); 

 

作用:分多行消失特效

参数1:特效持续的时间

参数2:行数

#include "T18Grid3D.h"

#include "AppMacros.h"

 

CCScene *T18Grid3D::scene()

{

    CCScene * scene = CCScene::create();

    T18Grid3D * layer = T18Grid3D::create();

    scene->addChild(layer);

    return scene;

}

 

bool T18Grid3D::init()

{

    TBack::init();

   

    //Grid3D

    CCSprite * spr = CCSprite::create("HelloWorld.png");

    spr->setPosition(ccp(winSize.width / 2, winSize.height / 2));

    addChild(spr);

 

    CCActionInterval * splitRows = CCSplitRows::create(5, 50);

   

    spr->runAction(splitRows);

 

    return true;

}

运行结果:

方块消失特效

CCActionInterval* turnOffFiels = CCTurnOffTiles::create(4, CCSize(50, 50));

sp->runAction(turnOffFiles);

作用:方块消失特效

参数1:特效持续的时间

参数2:网络大小

#include "T18Grid3D.h"

#include "AppMacros.h"

 

CCScene *T18Grid3D::scene()

{

    CCScene * scene = CCScene::create();

    T18Grid3D * layer = T18Grid3D::create();

    scene->addChild(layer);

    return scene;

}

 

bool T18Grid3D::init()

{

    TBack::init();

   

    //Grid3D

    CCSprite * spr = CCSprite::create("HelloWorld.png");

    spr->setPosition(ccp(winSize.width / 2, winSize.height / 2));

    addChild(spr);

 

    CCActionInterval * turnOffFiles = CCTurnOffTiles::create(

        4,                 //特效持续的时间

        CCSize(50,50));    //网格大小

 

    spr->runAction(turnOffFiles);

 

    return true;

}

运行结果(渐渐消失):

3D瓷砖波动特效

CCActionInterval * turnOffFiles = CCTurnOffTiles::create(

4,

CCSize(10,10),

10,

20);

作用:创建一个3D瓷砖波动特效

参数1:特效持续时间

参数2:网格大小

参数3:波动的速率

参数4:振幅

#include "T18Grid3D.h"

#include "AppMacros.h"

 

CCScene *T18Grid3D::scene()

{

    CCScene * scene = CCScene::create();

    T18Grid3D * layer = T18Grid3D::create();

    scene->addChild(layer);

    return scene;

}

 

bool T18Grid3D::init()

{

    TBack::init();

   

    //Grid3D

    CCSprite * spr = CCSprite::create("HelloWorld.png");

    spr->setPosition(ccp(winSize.width / 2, winSize.height / 2));

    addChild(spr);

 

    //3D瓷砖波动特效

    CCActionInterval* wavesTiles3D = CCWavesTiles3D::create(

        5,               //特效持续时间

        CCSize(10, 10),  //网格大小

        10,              //波动的速率

        20);             //振幅

 

    spr->runAction(wavesTiles3D);

 

    return true;

}

运行结果:

 

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

分享:
云计算
使用钉钉扫一扫加入圈子
+ 订阅

时时分享云计算技术内容,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。

其他文章
最新文章