순서대로 액션 실행하기 (Sequence)
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 "test129.hpp" USING_NS_CC; Scene* Test129::createScene() { auto scene = Scene::create(); auto layer = Test129::create(); scene->addChild(layer); return scene; } bool Test129::init() { if ( !Layer::init()) { return false; } auto sprite = Sprite::create("ball.png"); sprite->setPosition(Point(100,100)); this->addChild(sprite); auto action1 = MoveTo::create(2.0, Point(400,100)); auto action2 = MoveTo::create(2.0, Point(400,250)); //Sequence::create(액션1, 액션2,..., NULL) : 순서대로 액션을 실행한다 auto action3 = Sequence::create(action1, action2, NULL); sprite->runAction(action3); return true; } | cs |
결과
액션1과 액션2가 순서대로 실행되어 위치가 이동된다
'IT > - 프로그래밍' 카테고리의 다른 글
Cocos 반대로 실행하는 액션기능 (reverse) (0) | 2017.02.22 |
---|---|
Cocos 여러 액션을 동시에 실행하기 (Spawn) (0) | 2017.02.21 |
OpenCV error C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. (0) | 2017.02.19 |
OpenCV R,G,B 를 H(색상) , S(채도) , V(명도) 로 바꾸는 공식 (0) | 2017.02.18 |
Cocos 지정한 RGB의 값으로 색상변경하는 액션기능 (TintTo) (0) | 2017.02.17 |