Advertisement
bynaki

BezierTo

Mar 5th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 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.     ccBezierConfig bezierConfig;
  13.     bezierConfig.controlPoint_1 = Point(200, 250);
  14.     bezierConfig.controlPoint_2 = Point(400, 150);
  15.     bezierConfig.endPosition = Point(450, 50);
  16.  
  17.     auto action = BezierTo:: create(3.0, bezierConfig);
  18.     spr->runAction(action);
  19.  
  20.     return true;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement