Advertisement
bynaki

MoveTo

Mar 4th, 2015
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. bool HelloWorld::init()
  2. {
  3.     if (!Layer::init())
  4.     {
  5.         return false;
  6.     }
  7.  
  8.     auto spr = Sprite::create("ball.png");
  9.     spr->setPosition(Point(50, 50));
  10.     this->addChild(spr);
  11.  
  12.     // 지정된 위치로 객체를 이동시키는 액션.
  13.     auto action = MoveTo::create(3.0, Point(450, 50));
  14.     // 객체에 지정된 액션을 바로 실행한다.
  15.     spr->runAction(action);
  16.  
  17.     return true;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement