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

Base class for Other grid. More...

Inherits Ref.

Inherited by Grid3D, and TiledGrid3D.

Public Member Functions

virtual ~GridBase (void)
 Destructor.
 
bool initWithSize (const Size &gridSize)
 Init the Grid base. More...
 
var initWithSize ( var gridSize)
 Init the Grid base. More...
 
local initWithSize ( local gridSize)
 Init the Grid base. More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
local 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...
 
local getReferenceCount ()
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor.
 

Static Public Member Functions

static GridBasecreate (const Size &gridSize, Texture2D *texture, bool flipped)
 create one Grid The grid size The texture pointer. More...
 
var create ( var gridSize, var texture, var flipped)
 create one Grid The grid size The texture pointer. More...
 
local create ( local gridSize, local texture, local flipped)
 create one Grid The grid size The texture pointer. More...
 
static GridBasecreate (const Size &gridSize)
 create one Grid The gride size. More...
 
var create ( var gridSize)
 create one Grid The gride size. More...
 
local create ( local gridSize)
 create one Grid The gride size. More...
 
bool isActive (void) const
 Get the active state of grid. More...
 
void setActive (bool active)
 Set the active state of grid. More...
 
int getReuseGrid (void) const
 Get number of times that the grid will be reused.
 
var getReuseGrid ()
 Get number of times that the grid will be reused.
 
local getReuseGrid ()
 Get number of times that the grid will be reused.
 
void setReuseGrid (int reuseGrid)
 Set number of times that the grid will be reused.
 
var setReuseGrid ( var reuseGrid)
 Set number of times that the grid will be reused.
 
local setReuseGrid ( local reuseGrid)
 Set number of times that the grid will be reused.
 
const SizegetGridSize (void) const
 Get the size of the grid.
 
var getGridSize ()
 Get the size of the grid.
 
local getGridSize ()
 Get the size of the grid.
 
void setGridSize (const Size &gridSize)
 Set the size of the grid.
 
var setGridSize ( var gridSize)
 Set the size of the grid.
 
local setGridSize ( local gridSize)
 Set the size of the grid.
 
const Vec2getStep (void) const
 Pixels between the grids.
 
local getStep ()
 Pixels between the grids.
 
void setStep (const Vec2 &step)
 Get the pixels between the grids.
 
var setStep ( var step)
 Get the pixels between the grids.
 
local setStep ( local step)
 Get the pixels between the grids.
 
bool isTextureFlipped (void) const
 is texture flipped.
 
var isTextureFlipped ()
 is texture flipped.
 
local isTextureFlipped ()
 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 Grid status before draw.
 
var beforeDraw ()
 Init and reset the Grid status before draw.
 
local beforeDraw ()
 Init and reset the Grid status before draw.
 
void afterDraw (Node *target)
 Init and reset the Grid status before draw. More...
 
var afterDraw ( var target)
 Init and reset the Grid status before draw. More...
 
local afterDraw ( local target)
 Init and reset the Grid status before draw. More...
 
virtual void beforeBlit ()
 Interface for custom action when before blit.
 
local beforeBlit ()
 Interface for custom action when before blit.
 
virtual void afterBlit ()
 Interface for custom action when after blit.
 
var afterBlit ()
 Interface for custom action when after blit.
 
local afterBlit ()
 Interface for custom action when after blit.
 
virtual void blit (void)
 Used to blit the texture with grid to screen.
 
local blit ()
 Used to blit the texture with grid to screen.
 
virtual void reuse (void)
 Reuse the grid vertices.
 
var reuse ()
 Reuse the grid vertices.
 
local reuse ()
 Reuse the grid vertices.
 
virtual void calculateVertexPoints (void)
 Calculate the vertices used for the blit.
 
local calculateVertexPoints ()
 Calculate the vertices used for the blit.
 
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. 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...
 

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.
 
bool _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 
local _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 

Detailed Description

Base class for Other grid.

Member Function Documentation

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

create one Grid The grid size The texture pointer.

Whether texture flipped or not. A GridBase instance.

var create ( var  gridSize,
var  texture,
var  flipped 
)
static

create one Grid The grid size The texture pointer.

Whether texture flipped or not. A GridBase instance.

local create ( local  gridSize,
local  texture,
local  flipped 
)
static

create one Grid The grid size The texture pointer.

Whether texture flipped or not. A GridBase instance.

static GridBase* create ( const Size gridSize)
static

create one Grid The gride size.

A GridBase instance.

var create ( var  gridSize)
static

create one Grid The gride size.

A GridBase instance.

local create ( local  gridSize)
static

create one Grid The gride size.

A GridBase instance.

bool initWithSize ( const Size gridSize)

Init the Grid base.

the size of the grid. The texture used for grab. whether or not the grab texture should be flip by Y or not. True if initailize success, false otherwise.

var initWithSize ( var  gridSize)

Init the Grid base.

the size of the grid. The texture used for grab. whether or not the grab texture should be flip by Y or not. True if initailize success, false otherwise.

local initWithSize ( local  gridSize)

Init the Grid base.

the size of the grid. The texture used for grab. whether or not the grab texture should be flip by Y or not. True if initailize success, false otherwise.

bool isActive ( void  ) const
inline

Get the active state of grid.

Getter and setter of the active state of the grid.

var isActive (   )
inline

Get the active state of grid.

Getter and setter of the active state of the grid.

local isActive (   )
inline

Get the active state of grid.

Getter and setter of the active state of the grid.

void setActive ( bool  active)

Set the active state of grid.

true if the grid is active, false otherwise

var setActive ( var  active)

Set the active state of grid.

true if the grid is active, false otherwise

local setActive ( local  active)

Set the active state of grid.

true if the grid is active, false otherwise

void afterDraw ( Node target)

Init and reset the Grid status before draw.

A Node pointer.

var afterDraw ( var  target)

Init and reset the Grid status before draw.

A Node pointer.

local afterDraw ( local  target)

Init and reset the Grid status before draw.

A Node pointer.

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: