Cocos2d-x game engine development notes (16) animation Speed Control

Source: Internet
Author: User

Original article, reproduced please indicate the source: http://blog.csdn.net/zhy_cheng/article/details/8426332

In the previous blog, I introduced animation, but I didn't mention animation speed control.

Animation speed control is when the animation is fast and slow.

Now, let's learn two English words.

Comfort: Easy and leisurely. In the following API, it should be understood as slow.

Exponential: exponential. Exponential Growth: This growth speed is faster than linear growth. The following APIs are extremely fast.

Cceasein-from slow to fast (linear speed change), slow at the beginning
Cceaseout-from fast to slow, then slow
Cceaseinout-from slow to fast, then from fast to slow, start time and then slow
Cceasesinein-from slow to fast (speed sine variation)
Cceasesineout-from fast to slow
Cceasesineinout-from slow to fast and then from fast to slow
Cceaseexponentialin-from extremely slow (speed exponential change)
Cceaseexponentialout-from extremely fast to slow
Cceaseexponentialinout-from extremely slow to extremely slow
The above description is very detailed. Next, try it.

Ccsprite * s = ccsprite: Create ("sprite.png"); s-> setposition (CCP (0, 0); addchild (s); ccactioninterval * Move = ccmoveby :: create (3, CCP (450,290); ccactioninterval * A = cceasein: Create (move, // pass a ccactioninterval pointer 2 // rate to determine the speed change speed );

The second parameter should be greater than 1 and can be adjusted as needed.

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.