[7] CCAction for coco2d-x core class

Source: Internet
Author: User

CCAction is not an object displayed on the screen. CCAction must be attached to a CCNode instance to play its role. The CCAction class inheritance relationship is shown in figure

CCAction has three subclasses: CCFiniteTimeAction, CCFollow, and CCSpeed)

I. CCFiniteTimeAction

1: CCActionInStant: The action that calls the result directly without any animation effect.

2: CCActionInterval (delayed action): The animation process is formed.

Example: ActionTest for the test project

 

Ii. CCFollow

The following action is the action that one node follows another node.

Iii. CCSpeed

CCSpeed is not an independent action, but a package of the current action. After packaging, this action can achieve slow and fast forward effects.

1 indicates the source speed, acceleration greater than 1, and deceleration less than 1

 

Iv. Action Delay

The CCDelayTime action is delayed for a fixed period of time, with only time and no action.

The code in the figure above indicates that the move action is executed first, and the move action is executed two seconds later.

 

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.