Cocos2d-x Study Notes 2-Actions (basic)-unfinished

Source: Internet
Author: User
//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 Study Notes 2-Actions (basic)-unfinished

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.