//載入一張圖片
CCSprite* leftDoor = CCSprite::create("loading/door.png");
leftDoor->setAnchorPoint(ccp(1, 0.5)); //設置錨點為右邊中心點
leftDoor->setPosition(ccp(240, 160)); //設置圖片位置
leftDoor->setScaleX(-1); //設置鏡像翻轉
this->addChild(leftDoor);
//移動動作
CCMoveTo* move = CCMoveTo::create(1.0f, ccp(480, 160));
boom->runAction(move);
//旋轉動作
CCRotateTo* rotate = CCRotateTo::create(1.0f, 180);
boom->runAction(rotate);
//縮放動作
CCScaleTo* scale = CCScaleTo::create(1.0f, 2, 0.5);
boom->runAction(scale);
//隱藏
CCHide* hide = CCHide::create();
boom->runAction(hide);
//顯示
CCShow* show = CCShow::create();
boom->runAction(show);
//顯示隱藏切換
CCToggleVisibility* tv = CCToggleVisibility::create();
boom->runAction(tv);
//延時等待
CCDelayTime* delaytime = CCDelayTime::create(1.0f);
boom->runAction(delaytime);
//序列動畫
CCSequence* sequence = CCSequence::create(move, rotate, scale, NULL);
boom->runAction(sequence);
//並行動畫
CCSpawn* spawn = CCSpawn::create(move, rotate, scale, NULL);
boom->runAction(spawn);
//調用函數
CCCallFunc* cf = CCCallFunc::create(this,callfunc_selector(HelloWorld::animationEnd));
CCSequence* sequence = CCSequence::create(move1, move2, hide, delaytime, show, cf, NULL);
boom->runAction(sequence);
//重復執行
CCRepeat* repeat = CCRepeat::create(sequence, 3); //指定重復次數
CCRepeatForever* repeatforever = CCRepeatForever::create(sequence); //無線循環
boom->runAction(repeat);
//緩動效果
CCMoveTo* move1 = CCMoveTo::create(1.0f, ccp(0, 160));
CCEaseBackIn* easebackin = CCEaseBackIn::create(move1);
boom->runAction(easebackin);
//綁定多個控件
CCNode* leftNode = CCNode::create();
leftNode->addChild(leftDoor);
leftNode->addChild(leftLogo);
this->addChild(leftNode);
