While using ccWave, one of the parameters was grid
and it showed that the value should be of type ccGridSize
.
I would like to know what a ccGridSize
is..
What value should be given for a ccGridSize
variable?
The code for ccWaves is as follows...
[CCWaves actionWithWaves:<(int)> amplitude:<(float)>
horizontal:<(BOOL)> vertical:<(BOOL)>
grid:<(ccGridSize)> duration:<(ccTime)>];
What value can be given in the place of the parameter grid???
Cocos2d defines ccGridSize
as:
typedef struct _ccGridSize
{
NSInteger x;
NSInteger y;
} ccGridSize;
And provides an inline factory function:
static inline ccGridSize ccg(const NSInteger x, const NSInteger y);
So you can write your call as:
... grid:ccg(gridSizeX, gridSizeY)
Where gridSizeX
and gridSizeY
define a number of grid columns and rows for your effect.
From cctypes.h
:
typedef struct _ccGridSize
{
NSInteger x;
NSInteger y;
} ccGridSize;
So it's just a couple of ints to state how big every step is of the grid that you are going to animate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With