cocos2d-x  3.5
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GridBase Class Reference

Base class for Other grid. More...

#include <CCGrid.h>

Inheritance diagram for GridBase:
Ref Grid3D TiledGrid3D

Public Member Functions

virtual ~GridBase (void)
 Destructor. More...
 
int getReuseGrid (void) const
 Get number of times that the grid will be reused. More...
 
void setReuseGrid (int reuseGrid)
 Set number of times that the grid will be reused. More...
 
const SizegetGridSize (void) const
 Size of the grid. More...
 
void setGridSize (const Size &gridSize)
 Set the size of the grid. More...
 
const Vec2getStep (void) const
 Pixels between the grids. More...
 
void setStep (const Vec2 &step)
 Get the pixels between the grids. More...
 
bool isTextureFlipped (void) const
 is texture flipped. More...
 
void setTextureFlipped (bool flipped)
 Set the texture flipped or not. More...
 
virtual void blit (void)
 Interface used to blit the texture with grid to screen. More...
 
virtual void reuse (void)
 Interface, Reuse the grid vertices. More...
 
virtual void calculateVertexPoints (void)
 Interface, Calculate the vertices used for the blit. More...
 
void set2DProjection (void)
 Change projection to 2D for grabbing. More...
 
bool initWithSize (const Size &gridSize, Texture2D *texture, bool flipped)
bool initWithSize (const Size &gridSize)
bool isActive (void) const
void setActive (bool active)
void beforeDraw (void)
void afterDraw (Node *target)
virtual void beforeBlit ()
virtual void afterBlit ()
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor. More...
 

Static Public Member Functions

static GridBasecreate (const Size &gridSize, Texture2D *texture, bool flipped)
 create one Grid More...
 
static GridBasecreate (const Size &gridSize)
 create one Grid More...
 

Protected Attributes

bool _active
int _reuseGrid
Size _gridSize
Texture2D_texture
Vec2 _step
Grabber_grabber
bool _isTextureFlipped
GLProgram_shaderProgram
Director::Projection _directorProjection
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 

Additional Inherited Members

- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 

Detailed Description

Base class for Other grid.

Constructor & Destructor Documentation

virtual ~GridBase ( void  )
virtual

Destructor.

Member Function Documentation

virtual void afterBlit ( )
inlinevirtual

Reimplemented in Grid3D.

void afterDraw ( Node target)
virtual void beforeBlit ( )
inlinevirtual

Interface for custom action when before or after draw.

Reimplemented in Grid3D.

void beforeDraw ( void  )

Init and reset the status when render effects by using the grid.

virtual void blit ( void  )
virtual

Interface used to blit the texture with grid to screen.

Reimplemented in TiledGrid3D, and Grid3D.

virtual void calculateVertexPoints ( void  )
virtual

Interface, Calculate the vertices used for the blit.

Reimplemented in TiledGrid3D, and Grid3D.

static GridBase* create ( const Size gridSize,
Texture2D texture,
bool  flipped 
)
static

create one Grid

static GridBase* create ( const Size gridSize)
static

create one Grid

const Size& getGridSize ( void  ) const
inline

Size of the grid.

int getReuseGrid ( void  ) const
inline

Get number of times that the grid will be reused.

const Vec2& getStep ( void  ) const
inline

Pixels between the grids.

bool initWithSize ( const Size gridSize,
Texture2D texture,
bool  flipped 
)

Init the Grid base.

Parameters
gridSizethe size of the grid.
textureThe texture used for grab.
flippedwhether or not the grab texture should be flip by Y or not.
bool initWithSize ( const Size gridSize)
bool isActive ( void  ) const
inline

Getter and setter of the active state of the grid.

bool isTextureFlipped ( void  ) const
inline

is texture flipped.

virtual void reuse ( void  )
virtual

Interface, Reuse the grid vertices.

Reimplemented in TiledGrid3D, and Grid3D.

void set2DProjection ( void  )

Change projection to 2D for grabbing.

void setActive ( bool  active)
void setGridSize ( const Size gridSize)
inline

Set the size of the grid.

void setReuseGrid ( int  reuseGrid)
inline

Set number of times that the grid will be reused.

void setStep ( const Vec2 step)
inline

Get the pixels between the grids.

void setTextureFlipped ( bool  flipped)

Set the texture flipped or not.

Member Data Documentation

bool _active
protected
Director::Projection
_directorProjection
protected
Grabber* _grabber
protected
Size _gridSize
protected
bool _isTextureFlipped
protected
int _reuseGrid
protected
GLProgram* _shaderProgram
protected
Vec2 _step
protected
Texture2D* _texture
protected

The documentation for this class was generated from the following file: