cocos2d-x之action初试

bool HelloWorld::init()

{

if ( !Layer::init() )

{

return false;

}

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

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

auto role=Sprite::create("fen.png");

addChild(role);

role->setPosition(visibleSize/2);

role->setScale(0.5);

role->setPositionX(100);

//role->runAction(MoveTo::create(2,Vec2(visibleSize.width-100,visibleSize.height/2)));

/*auto mov1=MoveTo::create(2,Vec2(visibleSize.width-100,visibleSize.height/2));

auto mov2=MoveBy::create(2,Vec2(-1000,0));

role->runAction(Sequence::create(mov1,mov2, NULL));*/

/*auto mov1=MoveBy::create(2,Vec2(1000,0));

auto mov2=mov1->reverse();

role->runAction(Sequence::create(mov1,mov2,NULL));*/

auto move=MoveBy::create(2,Vec2(1000,0));

auto scale=ScaleTo::create(2,1);

//role->runAction(Spawn::create(move,scale,NULL));

role->runAction(Sequence::create(Spawn::create(move,scale,NULL),CallFunc::create([](){

CCLOG("PLAY COMPLETED");

}),NULL));

return true;

}

上一篇:SQL Server Delete Duplicate Rows


下一篇:新浪微博.Net SDK第三版源代码和示例【最后一次更新了】