[Effects] cocos2-dx 이펙트에 대해서 알아보자!

|

Effects

소개.

Effects는 action의 한 종류이다.. 투명도를 조절하거나 회전 혹은 크기 변경 등 일반 속성을 수정할수있다, grid라는 속성을 수정합니다.

grid 속성은 matrix와 비슷한데, it is a network of lines that cross each other to form a series of squares or rectangles.

These special actions render any CocosNode object (Layer, Scene, Sprite, etc.) into the grid, and you can transform the grid by moving its vertices.

2가지 종류의 grid가 있는데 하나는 타일 그리드이고 나머지 하나는 non-tiled 그리드입니다. 

차이점은 타일 그리드는 각각의 타일이 정점으로 구성되는데 반해  non-titled그리드는 4개의 정점으로 구성됩니다.

(non-tiled) grid:
 

타일그리드
 

사용하는 방법

다른 Action과 마찬가지로 runAction에서 실행됩니다.

1// Create an sprite
2CCSprite* grossini = CCSprite::create("grossini.png");
3grossini->runAction(CCLiquid::create(4, 20, ccg(10,10), 5));


Liquid,다른 grid 와 마찬가지로 grid 피라메터를 받는다. 원하는 그리드의 크기를 증가시킴으로써 이펙트의 품질을 조정할 수있다. 그러나 FPS가 떨어질수있음..

당신이 다른 어떤 Action처럼 취급 할 수 있도록 효과 IntervalAction 작업입니다. 예를 들면 :

1// create a Lens3D action
2CCActionInterval* lens = CCLens3D::create(ccp(240,160),240,ccg(15,10),8);
3
4// create a Waved3D action
5CCActionInterval* waves = CCWaves3D::create(18,80,ccg(15,10),10);
6
7// create a sequence an repeat it forever
8grossini->runAction(CCRepeatForever::create((CCSequence*)CCSequence::create(waves, lens, NULL ) ) );


(non-tiled) 액션

Shaky3D  Waves3D  FlipX3D  FlipY3D  
Lens3D  Liquid  Waves  Twirl  
Ripple3D  


타일 그리드 액션

ShakyTiles3D  ShatteredTiles3D  ShuffleTiles  FadeOutTRTiles  
FadeOutBLTiles  FadeOutUpTiles  FadeOutDownTiles  TurnOffTiles  
WavesTiles3D Sort_descJumpTiles3D  SplitRows  SplitCols  

References


Trackback 0 And Comment 0
prev | 1 | 2 | 3 | 4 | 5 | 6 | 7 | next