cocos2d-x之Action特效

时间:2023-07-30 18:03:13

bool HelloWorld::init()

{

if ( !Layer::init() )

{

return false;

}

Size visibleSize = Director::getInstance()->getVisibleSize();

Vec2 origin = Director::getInstance()->getVisibleOrigin();

auto role=NodeGrid::create();

role->addChild(Sprite::create("fen.png"));

role->setPosition(visibleSize/2);

addChild(role);

//role->runAction(Shaky3D::create(10,Size(50,50),5,false));

//role->runAction(ShakyTiles3D::create(10,Size(50,50),5,false));

//role->runAction(ShuffleTiles::create(1,Size(50,50),5));

//auto shaky=ShakyTiles3D::create(1,Size(50,50),5,false);

//auto shuffle=ShuffleTiles::create(0.5,Size(50,50),25);

//role->runAction(Sequence::create(shaky,shuffle,NULL));

//role->runAction(TurnOffTiles::create(1,Size(50,50),25));

//role->runAction(Waves3D::create(2,Size(15,10),5,40));

auto w1=Waves3D::create(2,Size(15,10),5,40);

auto w2=Waves3D::create(2,Size(15,10),5,0);

role->runAction(Sequence::create(w1,w2,NULL));

return true;

}