Cocos2d-x  v3.17
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
GridBase Class Reference

Base class for Other grid. More...

Inherits Ref.

Inherited by Grid3D, and TiledGrid3D.

Public Member Functions

virtual ~GridBase (void)
 Destructor.
 
int getReuseGrid () 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 Size & getGridSize () const
 Size of the grid. More...
 
void setGridSize (const Size &gridSize)
 Set the size of the grid. More...
 
const Vec2getStep () const
 Pixels between the grids. More...
 
void setStep (const Vec2 &step)
 Get the pixels between the grids. More...
 
bool isTextureFlipped () 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...
 
void setGridRect (const Rect &rect)
 Set the effect grid rect. More...
 
const RectgetGridRect () const
 Get the effect grid rect. More...
 
bool initWithSize (const Size &gridSize)
bool isActive () const
void beforeDraw (void)
virtual void beforeBlit ()
- 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
 
static GridBasecreate (const Size &gridSize)
 create one Grid
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 

Detailed Description

Base class for Other grid.

Member Function Documentation

bool initWithSize ( const Size &  gridSize)

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.
rectThe effective grid rect.
bool isActive ( ) const
inline

Getter and setter of the active state of the grid.

int getReuseGrid ( ) const
inline

Get number of times that the grid will be reused.

void setReuseGrid ( int  reuseGrid)
inline

Set number of times that the grid will be reused.

const Size& getGridSize ( ) const
inline

Size of the grid.

void setGridSize ( const Size &  gridSize)
inline

Set the size of the grid.

const Vec2& getStep ( ) const
inline

Pixels between the grids.

void setStep ( const Vec2 step)
inline

Get the pixels between the grids.

bool isTextureFlipped ( ) const
inline

is texture flipped.

void setTextureFlipped ( bool  flipped)

Set the texture flipped or not.

void beforeDraw ( void  )

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

virtual void beforeBlit ( )
inlinevirtual

Interface for custom action when before or after draw.

Reimplemented in Grid3D.

virtual void blit ( void  )
virtual

Interface used to blit the texture with grid to screen.

Reimplemented in TiledGrid3D, and Grid3D.

virtual void reuse ( void  )
virtual

Interface, Reuse the grid vertices.

Reimplemented in TiledGrid3D, and Grid3D.

virtual void calculateVertexPoints ( void  )
virtual

Interface, Calculate the vertices used for the blit.

Reimplemented in TiledGrid3D, and Grid3D.

void set2DProjection ( void  )

Change projection to 2D for grabbing.

void setGridRect ( const Rect rect)

Set the effect grid rect.

Parameters
rectThe effect grid rect.
const Rect& getGridRect ( ) const
inline

Get the effect grid rect.

Returns
Return the effect grid rect.

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