axmol/cocos/2d/CCNodeGrid.h

47 lines
846 B
C
Raw Normal View History

2013-12-10 10:50:31 +08:00
#ifndef __MISCNODE_CCGRID_NODE_H__
#define __MISCNODE_CCGRID_NODE_H__
#include "CCNode.h"
2013-12-18 17:19:50 +08:00
#include "kazmath/GL/matrix.h"
2013-12-10 10:50:31 +08:00
NS_CC_BEGIN
class GridBase;
class NodeGrid : public Node
2013-12-10 10:50:31 +08:00
{
public:
static NodeGrid* create();
2013-12-10 10:50:31 +08:00
GridBase* getGrid() { return _nodeGrid; }
2013-12-10 10:50:31 +08:00
/**
* @js NA
*/
const GridBase* getGrid() const { return _nodeGrid; }
2013-12-10 10:50:31 +08:00
/**
* Changes a grid object that is used when applying effects
*
* @param grid A Grid object that is used when applying effects
*/
void setGrid(GridBase *grid);
2013-12-10 10:50:31 +08:00
virtual bool init();
virtual void visit();
void setTarget(Node *target);
2013-12-10 10:50:31 +08:00
protected:
NodeGrid();
virtual ~NodeGrid();
2013-12-10 10:50:31 +08:00
2013-12-18 17:19:50 +08:00
void onGridBeginDraw();
void onGridEndDraw();
2013-12-10 10:50:31 +08:00
protected:
2013-12-18 17:19:50 +08:00
kmMat4 _cachedMVmat;
Node* _gridTarget;
2013-12-10 10:50:31 +08:00
GridBase* _nodeGrid;
};
NS_CC_END
#endif