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...
 
var getReuseGrid ()
 Get number of times that the grid will be reused. More...
 
local getReuseGrid ()
 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...
 
var getGridSize ()
 Size of the grid. More...
 
local getGridSize ()
 Size of the grid. More...
 
void setGridSize (const Size &gridSize)
 Set the size of the grid. More...
 
local setGridSize ( local gridSize)
 Set the size of the grid. More...
 
const Vec2getStep () const
 Pixels between the grids. More...
 
local getStep ()
 Pixels between the grids. More...
 
void setStep (const Vec2 &step)
 Get the pixels between the grids. More...
 
local setStep ( local step)
 Get the pixels between the grids. More...
 
bool isTextureFlipped () const
 is texture flipped. More...
 
var isTextureFlipped ()
 is texture flipped. More...
 
local isTextureFlipped ()
 is texture flipped. More...
 
void setTextureFlipped (bool flipped)
 Set the texture flipped or not. More...
 
var setTextureFlipped ( var flipped)
 Set the texture flipped or not. More...
 
local setTextureFlipped ( local flipped)
 Set the texture flipped or not. More...
 
virtual void blit (void)
 Interface used to blit the texture with grid to screen. More...
 
local blit ()
 Interface used to blit the texture with grid to screen. More...
 
virtual void reuse (void)
 Interface, Reuse the grid vertices. More...
 
local reuse ()
 Interface, Reuse the grid vertices. More...
 
virtual void calculateVertexPoints (void)
 Interface, Calculate the vertices used for the blit. More...
 
local calculateVertexPoints ()
 Interface, Calculate the vertices used for the blit. More...
 
void set2DProjection (void)
 Change projection to 2D for grabbing. More...
 
var set2DProjection ()
 Change projection to 2D for grabbing. More...
 
local set2DProjection ()
 Change projection to 2D for grabbing. More...
 
void setGridRect (const Rect &rect)
 Set the effect grid rect. More...
 
var setGridRect ( var rect)
 Set the effect grid rect. More...
 
local setGridRect ( local rect)
 Set the effect grid rect. More...
 
const RectgetGridRect () const
 Get the effect grid rect. More...
 
var getGridRect ()
 Get the effect grid rect. More...
 
local getGridRect ()
 Get the effect grid rect. More...
 
bool initWithSize (const Size &gridSize)
var initWithSize ( var gridSize)
local initWithSize ( local gridSize)
bool isActive () const
var isActive ()
local isActive ()
void beforeDraw (void)
virtual void beforeBlit ()
local beforeBlit ()
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
local 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...
 
local getReferenceCount ()
 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
 
var create ( var gridSize, var texture, var flipped)
 create one Grid
 
local create ( local gridSize, local texture, local flipped)
 create one Grid
 
static GridBasecreate (const Size &gridSize)
 create one Grid
 
var create ( var gridSize)
 create one Grid
 
local create ( local gridSize)
 create one Grid
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
local _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
local _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
local _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 
local _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.
var initWithSize ( var  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.
local initWithSize ( local  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.

var isActive ( )
inline

Getter and setter of the active state of the grid.

local isActive ( )
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.

var getReuseGrid ( )
inline

Get number of times that the grid will be reused.

local getReuseGrid ( )
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.

var setReuseGrid ( var  reuseGrid)
inline

Set number of times that the grid will be reused.

local setReuseGrid ( local  reuseGrid)
inline

Set number of times that the grid will be reused.

const Size& getGridSize ( ) const
inline

Size of the grid.

var getGridSize ( )
inline

Size of the grid.

local getGridSize ( )
inline

Size of the grid.

void setGridSize ( const Size &  gridSize)
inline

Set the size of the grid.

var setGridSize ( var  gridSize)
inline

Set the size of the grid.

local setGridSize ( local  gridSize)
inline

Set the size of the grid.

const Vec2& getStep ( ) const
inline

Pixels between the grids.

var getStep ( )
inline

Pixels between the grids.

local getStep ( )
inline

Pixels between the grids.

void setStep ( const Vec2 step)
inline

Get the pixels between the grids.

var setStep ( var  step)
inline

Get the pixels between the grids.

local setStep ( local  step)
inline

Get the pixels between the grids.

bool isTextureFlipped ( ) const
inline

is texture flipped.

var isTextureFlipped ( )
inline

is texture flipped.

local isTextureFlipped ( )
inline

is texture flipped.

void setTextureFlipped ( bool  flipped)

Set the texture flipped or not.

var setTextureFlipped ( var  flipped)

Set the texture flipped or not.

local setTextureFlipped ( local  flipped)

Set the texture flipped or not.

void beforeDraw ( void  )

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

var beforeDraw (   )

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

local beforeDraw (   )

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.

local 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.

var blit (   )
virtual

Interface used to blit the texture with grid to screen.

Reimplemented in TiledGrid3D, and Grid3D.

local blit (   )
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.

var reuse (   )
virtual

Interface, Reuse the grid vertices.

Reimplemented in TiledGrid3D, and Grid3D.

local reuse (   )
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.

var calculateVertexPoints (   )
virtual

Interface, Calculate the vertices used for the blit.

Reimplemented in TiledGrid3D, and Grid3D.

local calculateVertexPoints (   )
virtual

Interface, Calculate the vertices used for the blit.

Reimplemented in TiledGrid3D, and Grid3D.

void set2DProjection ( void  )

Change projection to 2D for grabbing.

var set2DProjection (   )

Change projection to 2D for grabbing.

local set2DProjection (   )

Change projection to 2D for grabbing.

void setGridRect ( const Rect rect)

Set the effect grid rect.

Parameters
rectThe effect grid rect.
var setGridRect ( var  rect)

Set the effect grid rect.

Parameters
rectThe effect grid rect.
local setGridRect ( local  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.
var getGridRect ( )
inline

Get the effect grid rect.

Returns
Return the effect grid rect.
local getGridRect ( )
inline

Get the effect grid rect.

Returns
Return the effect grid rect.

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