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.