码迷,mamicode.com
首页 > 其他好文 > 详细

Cocos2d-x 学习笔记2 - Actions(Basic) - 未完成

时间:2014-10-26 19:40:07      阅读:273      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   io   os   ar   for   strong   sp   

//Example:
//reverse \ clone \ DelayTime \ EaseIn | EaseOut
void
SpriteEase::onEnter() { EaseSpriteDemo::onEnter(); auto move = MoveBy::create(3, Vec2(VisibleRect::right().x-130,0)); auto move_back = move->reverse();//action‘s reverse auto move_ease_in = EaseIn::create(move->clone(), 2.5f);//action‘s clone, easeIn auto move_ease_in_back = move_ease_in->reverse(); auto move_ease_out = EaseOut::create(move->clone(), 2.5f);//EaseOut auto move_ease_out_back = move_ease_out->reverse(); auto delay = DelayTime::create(0.25f);//delay can also be treated as a "action" to add to sequence
//The rest of the code is trivial auto seq1
= Sequence::create(move, delay, move_back, delay->clone(), nullptr);//delay can also be cloned(basically it is a type of actions) auto seq2 = Sequence::create(move_ease_in, delay->clone(), move_ease_in_back, delay->clone(), nullptr); auto seq3 = Sequence::create(move_ease_out, delay->clone(), move_ease_out_back, delay->clone(), nullptr); auto a2 = _grossini->runAction(RepeatForever::create(seq1)); a2->setTag(1); auto a1 = _tamara->runAction(RepeatForever::create(seq2)); a1->setTag(1); auto a = _kathia->runAction(RepeatForever::create(seq3)); a->setTag(1); schedule(schedule_selector(SpriteEase::testStopAction), 6.25f); }

Cocos2d-x 学习笔记2 - Actions(Basic) - 未完成

标签:style   blog   color   io   os   ar   for   strong   sp   

原文地址:http://www.cnblogs.com/YiranXie/p/4052567.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!