Effects are special kinds of actions. Instead of modifying normal properties like
opacity
, position
, rotation
, or scale
, they modify a new kind of property: the grid
property.A
grid
property is like a matrix, it is a network of lines that cross each other to form a series of squares or rectangles.The grids have 2 dimensions: rows and columns, but each vertex of the grid has 3 dimension: x, y and z. So you can create 2d or 3d effects by transforming a tiled-grid-3D grid.
A tiled-grid-3D of size (3, 2)
Each frame the screen is rendered into a texture. This texture is transformed into a vertex array and this vertex array (the grid!) is transformed by the grid effects. Finally the vertex array is rendered into the screen.
Enable 3D Projection
[director setProjection:kCCDirectorProjection3D];
Tiled Grid 3D Actions
- CCFadeOutBLTiles
example:
id effect = [CCFadeOutBLTiles actionWithSize:ccg(32, 24) duration:3];
[mySprite runAction:effect];
example:
id effect = [CCFadeOutDownTiles actionWithSize:ccg(32, 24) duration:3];
- CCFadeOutDownTiles
example:
id effect = [CCFadeOutDownTiles actionWithSize:ccg(32, 24) duration:3];
[mySprite runAction:effect];
example:
id effect = [CCFadeOutTRTiles actionWithSize:ccg(32, 24) duration:3];
[mySprite runAction:effect];
example:
- CCFadeOutTRTiles
example:
id effect = [CCFadeOutTRTiles actionWithSize:ccg(32, 24) duration:3];
[mySprite runAction:effect];
- CCFadeOutUpTiles
example:
id effect = [CCFadeOutUpTiles actionWithSize:ccg(32, 24) duration:3];
[mySprite runAction:effect];
[mySprite runAction:effect];
- CCFadeIutDownTiles
Fades out the tiles in downwards direction.
example:
example:
id effect = [CCFadeOutDownTiles actionWithSize:ccg(32, 24) duration:3];
[mySprite runAction:effect];
example:
id effect = [CCJumpTiles3D actionWithJumps:6 amplitude:20 grid:ccg(32, 24) duration:3];[mySprite runAction:effect];
- CCJumpTiles3D
example:
[mySprite runAction:effect];
- CCShakyTiles3D
Shaky the tiles.
example:
id effect = [CCShakyTiles3D actionWithRange:2 shakeZ:YES grid:ccg(32, 24) duration:3];example:
[mySprite runAction:effect];
- CCShatteredTiles3D
Shatter the tiles.
example:
id effect = [CCShatteredTiles3D actionWithRange:2 shatterZ:YES grid:ccg(9, 9) duration:3];example:
[mySprite runAction:effect];
id effect = [CCShuffleTiles actionWithSeed:1 grid:ccg(32, 24) duration:3];
- CCShuffleTiles
Shuffle the tiles.
example:
example:
id effect = [CCShuffleTiles actionWithSeed:1 grid:ccg(32, 24) duration:3];
[mySprite runAction:effect];
example:
id effect = [CCSplitCols actionWithCols:20 duration:3];
- CCSplitCols
example:
id effect = [CCSplitCols actionWithCols:20 duration:3];
[mySprite runAction:effect];
example:
id effect = [CCSplitRows actionWithRows:6 duration:3];
- CCSplitRows
example:
id effect = [CCSplitRows actionWithRows:6 duration:3];
[mySprite runAction:effect];
example:
id effect = [CCTurnOffTiles actionWithSeed:3 grid:ccg(32, 24) duration:3];
- CCTurnOffTiles
example:
id effect = [CCTurnOffTiles actionWithSeed:3 grid:ccg(32, 24) duration:3];
[mySprite runAction:effect];
example:
id effect = [CCWavesTiles3D actionWithWaves:10 amplitude:6 grid:ccg(32, 24) duration:3];
- CCWavesTiles3D
example:
id effect = [CCWavesTiles3D actionWithWaves:10 amplitude:6 grid:ccg(32, 24) duration:3];
[mySprite runAction:effect];
沒有留言:
張貼留言