123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- #ifndef __MISCNODE_CCGRID_NODE_H__
- #define __MISCNODE_CCGRID_NODE_H__
- #include "2d/CCNode.h"
- #include "renderer/CCGroupCommand.h"
- #include "renderer/CCCustomCommand.h"
- NS_CC_BEGIN
- class GridBase;
- class CC_DLL NodeGrid : public Node
- {
- public:
-
- static NodeGrid* create();
-
- static NodeGrid* create(const Rect& rect);
-
-
- GridBase* getGrid() { return _nodeGrid; }
-
- const GridBase* getGrid() const { return _nodeGrid; }
-
- void setGrid(GridBase *grid);
-
-
- void setTarget(Node *target);
-
-
- void setGridRect(const Rect& gridRect) { _gridRect = gridRect; }
-
- const Rect& getGridRect() const { return _gridRect; }
-
- virtual void visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags) override;
- CC_CONSTRUCTOR_ACCESS:
- NodeGrid();
- virtual ~NodeGrid();
- protected:
- void onGridBeginDraw();
- void onGridEndDraw();
- Node* _gridTarget;
- GridBase* _nodeGrid;
- GroupCommand _groupCommand;
- CustomCommand _gridBeginCommand;
- CustomCommand _gridEndCommand;
-
- Rect _gridRect;
- private:
- CC_DISALLOW_COPY_AND_ASSIGN(NodeGrid);
- };
- NS_CC_END
- #endif
|