Cocos2d_x + lua ------ real-time Action of Action

Source: Internet
Author: User

I. Concept of instant action
The CCActionInstant class,
Most Real-Time actions have corresponding attribute setting methods. They are implemented as an action to form a continuous action with other actions,
The cocos2d-x provides the following immediate actions:

 

Ii. instant action usage
1. CCFlipX, horizontal flip, and effect: setFlipX (bool)

[Cpp]
Sprite: runAction (CCFlipX: actionWithFlipX (true ))
2. CCFlipY, vertical flip, and effect: setFlipY (bool)
[Cpp]
Sprite: runAction (CCFlipY: actionWithFlipY (true ))
3. CCHide, hide, and effect: setIsVisible (bool)
[Cpp]
Sprite: runAction (CCHide: action ())
4. CCPlace: setPosition (ccp (x, y ))
[Cpp]
Sprite: runAction (CCPlace: actionWithPosition (ccp (1, 2 )))
5. CCShow: setIsVisible (true)
[Cpp]
Sprite-> runAction (CCShow: action ())
6. CCReuseGrid, CCStopGrid, reuse grid, and stop grid are useless and should not be used frequently.

7. CCToggleVisibility and display switch effect: setIsVisible (! GetIsVisible ())
[Cpp]
Sprite: runAction (CCToggleVisibility: action ())
Iii. CCCallFunc and callback Functions

-- Use
[Cpp] www.2cto.com
Action = CCCallFuncN: actionWithScriptFuncName ("callbackSpriteFunc ")
Sprite: runAction (action)
 
Funtion callbackSpriteFunc ()
XXXXXXX
End
Several subclasses of CCCallFunc are similar, but the parameters are different.

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.