1
2
3
4
5
6
7
8
9
// cocos2d-x 2.2.3
CCLabelTTF* pLabelTTF = CCLabelTTF::create( "abcdefghijklmn", "Arial", 40 );
pLabelTTF->setPosition(ccp( 240, 20 ));
pLabelTTF->setColor(ccc3(240, 222, 171));
this->addChild(pLabelTTF);
CCMoveBy* move = CCMoveBy::create(2, ccp(0,200)); // 相对移动动作
CCFadeOut* fadeOut = CCFadeOut::create(2.0f); // 淡出动作
CCFiniteTimeAction* fadeOutAct = CCSpawn::create(fadeOut, move,NULL); // 移动淡出同时执行
pLabelTTF->runAction(fadeOutAct);