회전하는 액션기능 (RotateBy)
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 | #include "test118.hpp" USING_NS_CC; Scene* Test118::createScene() { auto scene = Scene::create(); auto layer = Test118::create(); scene->addChild(layer); return scene; } bool Test118::init() { if ( !Layer::init()) { return false; } auto sprite = Sprite::create("testimage.png"); sprite->setPosition(Point(100,100)); this->addChild(sprite); //RotateBy(액션시간, 회전각도) //RotateTo : 입력한 각도로 가장 빠르게 회전, RotateBy : +는 시계방향 -는 반시계방향으로 지정한 값만큼 회전 auto action = RotateBy::create(2.0, 450); //시계방향으로 450도 회전 sprite->runAction(action); return true; } | cs |
결과
'IT > - 프로그래밍' 카테고리의 다른 글
Cocos 보이게, 보이지 않게하는 액션기능 (Show, Hide) (0) | 2017.02.12 |
---|---|
OpenCV error LNK2019: _cvReleaseImage 외부 기호(참조 위치: _main 함수)에서 확인하지 못했습니다. (0) | 2017.02.11 |
Cocos 크기 변경하는 액션기능 (ScaleTo) (0) | 2017.02.09 |
Cocos 위치 변경하는 액셔기능 (Place) (0) | 2017.02.08 |
Cocos 베지어 액션기능 (BezierTo) (0) | 2017.02.07 |