액션기능으로 점프하기 (JumpBy)
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 | #include "test111.hpp" USING_NS_CC; Scene* Test111::createScene() { auto scene = Scene::create(); auto layer = Test111::create(); scene->addChild(layer); return scene; } bool Test111::init() { if ( !Layer::init()) { return false; } auto sprite = Sprite::create("ball.png"); //스프라이트 이미지 객체 sprite->setPosition(Point(100,100)); //이미지 위치 지정 this->addChild(sprite); //레이어에 추가 //JumpBy JumpTo : 지정한 위치로 객체의 위치를 변경해주면서 지정한 높이로 지정한 횟수만큼 점프하는 액션 //액션은 Node를 상속받은 객체(Layer , Sprite , Label)에 실행 //JumpBy::create(지속시간 , 위치 , 점프높이 , 점프횟수); auto action = JumpBy::create(5.0f, Point(300,0), 150, 4); sprite->runAction(action); return true; } | cs |
'IT > - 프로그래밍' 카테고리의 다른 글
Cocos 위치 변경하는 액셔기능 (Place) (0) | 2017.02.08 |
---|---|
Cocos 베지어 액션기능 (BezierTo) (0) | 2017.02.07 |
Cocos 기본액션표 (0) | 2017.02.05 |
OpenCV OpenCV 설치 (0) | 2017.02.04 |
안드로이드 다운받은 apk 파일 추출하기 (adb 명령어 사용) (0) | 2017.02.03 |