본문 바로가기

Cocos2d-x v3.17/기본기능

[Cocos2d-x 기본기능]FadeIn,FadeOut,TintTo,TintBy

반응형

FadeIn FadeOut

 

 FadeIn FadeOut  을 사용하여 페이드인,아웃을 조절한다.

페이드인은 노드의 투명도설정을 변경한다.

완전투명->완전불투명으로 동작하고 FadeOut은 반대이다. 


C++ 

auto mySprite = Sprite::create("mysprite.png"); 

// fades in the sprite in 1 seconds

auto fadeIn = FadeIn::create(1.0f);

mySprite->runAction(fadeIn); 

// fades out the sprite in 2 seconds

auto fadeOut = FadeOut::create(2.0f);

mySprite->runAction(fadeOut);

 

TintTo TintBy 

 

TintTo TintBy 를 사용하여 노드에대한 색채혼합을 한다. 


C++ 

auto mySprite = Sprite::create("mysprite.png"); 

// Tints a node to the specified RGB values

auto tintTo = TintTo::create(2.0f120.0f232.0f254.0f);

mySprite->runAction(tintTo); 

// Tints a node BY the delta of the specified RGB values.

auto tintBy = TintBy::create(2.0f120.0f232.0f254.0f);

mySprite->runAction(tintBy);


 

 

출처: <http://dygks910910.tistory.com/14?category=295210>

 


반응형