-
cocos2d-x 101 Encounters/catalogue
2 Scenes, Director, Layers, sprites
< Span style= "padding:0px;margin:0px;" >3 Create picture menu
5 Add a sprite sprite
5.1 Shrink the sprite and make it complete
6 Action, move sprite
7 3.0 Click event, Cctouchdelegate has deactivated
8 Using touch events to move sprites
Move a Sprite
650) this.width=650; "Src=" Http://uliweb.cpython.org/uploads/tutorial/45/3c326e44acfc11e3b746f23c91693c1b.png " Style= "Border:0px;height:auto;vertical-align:middle;" alt= "3c326e44acfc11e3b746f23c91693c1b.png"/>
On the basis of the previous section, the sprite will be one to 100,100 positions.
-
Action* actionMove =MoveTo::create(1.0,
-
ccp(100,100));
-
-
s->runAction(actionMove);
1. To create an action, 1.0 means to move the completed CCP within 1 seconds (100,100) target position 100,100
2. The Runaction Wizard begins to move.