Cocos2d-x project 101 encounter: action, mobile sprite

Source: Internet
Author: User

  • Cocos2d-x 101 encounter/directory
    1. Installation and environment setup-xcode
    2 Scenes, Director, Layers, Sprites
    3. Create an image menu
    4. Create a new scenario on HelloWorld
    5. Add a sprite.
    5.1 scale down sprite and display it completely
    6 action, mobile sprite
    3.0 Click Event, CCTouchDelegate has been disabled
    8 use the touch event mobile genie


Move a sprite

On the basis of the previous section, sprite is located from 1 to 100,100.

 
 
  1. Action * actionMove = MoveTo: create (1.0,
  2. Ccp (100,100 ));
  3. S-> runAction (actionMove );

1. Create an action. The value 1.0 indicates that the target position of the ccp (100,100) is 100,100 after the mobile operation is completed within one second.

2. The runaction Wizard starts to move.

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.