지정한 시간에 지정된 투명도로 변경해주는 액션기능 (FadeTo)
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 "test126.hpp" USING_NS_CC; Scene* Test126::createScene() { auto scene = Scene::create(); auto layer = Test126::create(); scene->addChild(layer); return scene; } bool Test126::init() { if ( !Layer::init()) { return false; } auto sprite = Sprite::create("testimage.png"); sprite->setPosition(Point(100,100)); this->addChild(sprite); //FadeTo::create(액션시간, 투명도) : 지정한 시간에 지정한 투명도로 변환한다 auto action = FadeTo::create(3.0, 128); sprite->runAction(action); return true; } | cs |
결과
testimage가 3초 후에 투명도 128로 변환한다
'IT > - 프로그래밍' 카테고리의 다른 글
OpenCV R,G,B 를 H(색상) , S(채도) , V(명도) 로 바꾸는 공식 (0) | 2017.02.18 |
---|---|
Cocos 지정한 RGB의 값으로 색상변경하는 액션기능 (TintTo) (0) | 2017.02.17 |
Cocos 서서히 투명, 불투명하게하는 액션기능 (FadeIn, FadeOut) (0) | 2017.02.15 |
Cocos visible의 값을 반대로 바꿔주는 액션기능 (ToggleVisibility) (0) | 2017.02.14 |
Cocos 깜박이게 하는 액션기능 (Blink) (0) | 2017.02.13 |