베지어 액션기능 (BezierTo)
c++)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | #include "test112.hpp" USING_NS_CC; Scene* Test112::createScene() { auto scene = Scene::create(); auto layer = Test112::create(); scene->addChild(layer); return scene; } bool Test112::init() { if ( !Layer::init()) { return false; } auto sprite = Sprite::create("ball.png"); //스프라이트 이미지 객체 sprite->setPosition(Point(50,50)); //위치 지정 this->addChild(sprite); //레이어에 추가 //베지어 곡선의 설정 ccBezierConfig config; config.controlPoint_1 = Point(200,250); //제어점 설정 config.controlPoint_2 = Point(400,150); //제어점 설정 config.endPosition = Point(450,50); //도착점 설정 //BezierTo::create(액션시간 , 설정) auto action = BezierTo::create(3.0f, config); //베지어 액션 생성 sprite->runAction(action); //노드에 액션 설정 return true; } | cs |
'IT > - 프로그래밍' 카테고리의 다른 글
Cocos 크기 변경하는 액션기능 (ScaleTo) (0) | 2017.02.09 |
---|---|
Cocos 위치 변경하는 액셔기능 (Place) (0) | 2017.02.08 |
Cocos 액션기능으로 점프하기 (JumpBy) (0) | 2017.02.06 |
Cocos 기본액션표 (0) | 2017.02.05 |
OpenCV OpenCV 설치 (0) | 2017.02.04 |