2012-08-10 18:14:04 +08:00
|
|
|
enum {
|
|
|
|
kCCNodeTagInvalid = -1,
|
|
|
|
};
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2012-02-02 15:58:10 +08:00
|
|
|
enum {
|
|
|
|
kCCNodeOnEnter,
|
|
|
|
kCCNodeOnExit
|
|
|
|
};
|
|
|
|
|
2013-02-26 05:49:24 +08:00
|
|
|
typedef enum {
|
2013-07-26 13:50:10 +08:00
|
|
|
// CC_GL_ALL = 0,
|
2013-02-26 05:49:24 +08:00
|
|
|
} ccGLServerState;
|
|
|
|
|
2013-04-02 17:52:08 +08:00
|
|
|
|
2012-01-30 17:47:47 +08:00
|
|
|
class CCNode : public CCObject
|
2011-06-14 14:31:25 +08:00
|
|
|
{
|
2013-07-04 12:50:17 +08:00
|
|
|
int getZOrder() const;
|
|
|
|
float getVertexZ() const;
|
2012-02-02 14:26:38 +08:00
|
|
|
void setVertexZ(float var);
|
2013-07-04 12:50:17 +08:00
|
|
|
float getRotation() const;
|
|
|
|
float getRotationX() const;
|
|
|
|
float getRotationY() const;
|
2012-02-02 14:26:38 +08:00
|
|
|
void setRotation(float newRotation);
|
2013-07-04 12:50:17 +08:00
|
|
|
float getScale() const;
|
2012-02-02 14:26:38 +08:00
|
|
|
void setScale(float scale);
|
2013-07-04 12:50:17 +08:00
|
|
|
float getScaleX() const;
|
2012-02-02 14:26:38 +08:00
|
|
|
void setScaleX(float newScaleX);
|
2013-07-04 12:50:17 +08:00
|
|
|
float getScaleY() const;
|
2012-02-02 14:26:38 +08:00
|
|
|
void setScaleY(float newScaleY);
|
2013-07-04 12:50:17 +08:00
|
|
|
void getPosition(float* x = 0, float* y = 0) const;
|
|
|
|
float getPositionX() const;
|
|
|
|
float getPositionY() const;
|
2012-02-02 14:26:38 +08:00
|
|
|
void setPosition(float x, float y);
|
2012-08-09 12:46:45 +08:00
|
|
|
void setPosition(CCPoint pos);
|
2012-02-02 14:26:38 +08:00
|
|
|
void setPositionX(float x);
|
|
|
|
void setPositionY(float y);
|
2013-07-04 12:50:17 +08:00
|
|
|
float getSkewX() const;
|
2012-02-02 14:26:38 +08:00
|
|
|
void setSkewX(float skewX);
|
2013-07-04 12:50:17 +08:00
|
|
|
float getSkewY() const;
|
2012-02-02 14:26:38 +08:00
|
|
|
void setSkewY(float skewY);
|
2013-07-04 12:50:17 +08:00
|
|
|
bool isVisible() const;
|
2012-06-15 17:26:11 +08:00
|
|
|
void setVisible(bool var);
|
2013-07-04 12:50:17 +08:00
|
|
|
CCPoint getAnchorPoint() const;
|
2012-02-02 14:26:38 +08:00
|
|
|
void setAnchorPoint(CCPoint point);
|
|
|
|
CCSize getContentSize();
|
2012-08-10 18:14:04 +08:00
|
|
|
void setContentSize(const CCSize & size);
|
2012-02-02 14:26:38 +08:00
|
|
|
int getTag();
|
|
|
|
void setTag(int var);
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2012-04-09 00:10:12 +08:00
|
|
|
CCArray* getChildren();
|
2012-02-02 14:26:38 +08:00
|
|
|
unsigned int getChildrenCount(void);
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2012-02-02 14:26:38 +08:00
|
|
|
CCCamera* getCamera();
|
|
|
|
CCGridBase* getGrid();
|
|
|
|
void setGrid(CCGridBase* pGrid);
|
2012-08-10 18:14:04 +08:00
|
|
|
CCPoint getAnchorPointInPoints();
|
2013-07-04 12:50:17 +08:00
|
|
|
bool isRunning() const;
|
2012-02-02 14:26:38 +08:00
|
|
|
CCNode* getParent();
|
|
|
|
void setParent(CCNode * var);
|
2012-06-15 17:26:11 +08:00
|
|
|
bool isIgnoreAnchorPointForPosition();
|
|
|
|
void ignoreAnchorPointForPosition(bool newValue);
|
2012-02-02 14:26:38 +08:00
|
|
|
void* getUserData();
|
|
|
|
void setUserData(void *var);
|
2012-08-10 18:14:04 +08:00
|
|
|
CCObject* getUserObject();
|
|
|
|
void setUserObject(CCObject* pObject);
|
|
|
|
CCGLProgram* getShaderProgram();
|
|
|
|
void setShaderProgram(CCGLProgram* pShaderProgram);
|
2013-07-04 12:50:17 +08:00
|
|
|
int getOrderOfArrival() const;
|
2012-08-10 18:14:04 +08:00
|
|
|
void setOrderOfArrival(int order);
|
2013-07-04 12:50:17 +08:00
|
|
|
ccGLServerState getGLServerState() const;
|
2012-08-10 18:14:04 +08:00
|
|
|
void setGLServerState(ccGLServerState state);
|
|
|
|
CCActionManager* getActionManager();
|
|
|
|
void setActionManager(CCActionManager* pActionMgr);
|
2012-08-31 18:29:44 +08:00
|
|
|
ccGLServerState getGLServerState(void);
|
|
|
|
void setGLServerState(ccGLServerState state);
|
2012-08-10 18:14:04 +08:00
|
|
|
CCScheduler* getScheduler();
|
|
|
|
void setScheduler(CCScheduler* pScheduler);
|
2012-08-28 14:53:52 +08:00
|
|
|
void addChild(CCNode * child);
|
|
|
|
void addChild(CCNode * child, int zOrder);
|
2012-02-02 14:26:38 +08:00
|
|
|
void addChild(CCNode * child, int zOrder, int tag);
|
|
|
|
void removeChild(CCNode* child, bool cleanup);
|
|
|
|
void removeAllChildrenWithCleanup(bool cleanup);
|
|
|
|
void reorderChild(CCNode * child, int zOrder);
|
|
|
|
void cleanup(void);
|
|
|
|
void draw(void);
|
|
|
|
void visit(void);
|
|
|
|
void transform(void);
|
|
|
|
void transformAncestors(void);
|
2013-07-19 14:57:02 +08:00
|
|
|
CCRect getBoundingBox(void) const;
|
2012-02-02 14:26:38 +08:00
|
|
|
|
2012-08-30 15:33:54 +08:00
|
|
|
CCAction* runAction(CCAction* action);
|
2012-02-02 14:26:38 +08:00
|
|
|
void stopAllActions(void);
|
|
|
|
void stopAction(CCAction* action);
|
|
|
|
|
|
|
|
void stopActionByTag(int tag);
|
|
|
|
CCAction* getActionByTag(int tag);
|
2013-07-04 12:50:17 +08:00
|
|
|
const char * description(void) const;
|
2012-02-02 14:26:38 +08:00
|
|
|
CCNode* getChildByTag(int tag);
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2013-07-22 13:42:58 +08:00
|
|
|
unsigned int getNumberOfRunningActions(void) const;
|
2011-06-14 14:31:25 +08:00
|
|
|
|
2012-02-02 14:26:38 +08:00
|
|
|
CCAffineTransform nodeToParentTransform(void);
|
|
|
|
CCAffineTransform parentToNodeTransform(void);
|
|
|
|
CCAffineTransform nodeToWorldTransform(void);
|
|
|
|
CCAffineTransform worldToNodeTransform(void);
|
|
|
|
|
|
|
|
CCPoint convertToNodeSpace(CCPoint worldPoint);
|
|
|
|
CCPoint convertToWorldSpace(CCPoint nodePoint);
|
|
|
|
CCPoint convertToNodeSpaceAR(CCPoint worldPoint);
|
|
|
|
CCPoint convertToWorldSpaceAR(CCPoint nodePoint);
|
|
|
|
CCPoint convertTouchToNodeSpace(CCTouch * touch);
|
|
|
|
CCPoint convertTouchToNodeSpaceAR(CCTouch * touch);
|
|
|
|
|
2012-02-02 15:58:10 +08:00
|
|
|
void removeFromParentAndCleanup(bool cleanup);
|
|
|
|
void removeChildByTag(int tag, bool cleanup);
|
|
|
|
|
2012-12-10 16:09:23 +08:00
|
|
|
void scheduleUpdateWithPriorityLua(LUA_FUNCTION nHandler, int priority);
|
2012-08-29 17:10:06 +08:00
|
|
|
void unscheduleUpdate(void);
|
|
|
|
|
2012-06-15 11:46:51 +08:00
|
|
|
static CCNode * create(void);
|
2012-02-02 14:26:38 +08:00
|
|
|
};
|
2013-04-02 17:52:08 +08:00
|
|
|
|
|
|
|
class CCNodeRGBA : public CCNode, public CCRGBAProtocol
|
|
|
|
{
|
|
|
|
CCNodeRGBA();
|
|
|
|
virtual ~CCNodeRGBA();
|
|
|
|
|
|
|
|
virtual bool init();
|
|
|
|
|
2013-07-04 12:50:17 +08:00
|
|
|
virtual GLubyte getOpacity() const;
|
|
|
|
virtual GLubyte getDisplayedOpacity() const;
|
2013-04-02 17:52:08 +08:00
|
|
|
virtual void setOpacity(GLubyte opacity);
|
|
|
|
virtual void updateDisplayedOpacity(GLubyte parentOpacity);
|
2013-07-04 12:50:17 +08:00
|
|
|
virtual bool isCascadeOpacityEnabled() const;
|
2013-04-02 17:52:08 +08:00
|
|
|
virtual void setCascadeOpacityEnabled(bool cascadeOpacityEnabled);
|
|
|
|
|
2013-07-08 11:34:31 +08:00
|
|
|
virtual const Color3B& getColor(void) const;
|
|
|
|
virtual const Color3B& getDisplayedColor() const;
|
|
|
|
virtual void setColor(const Color3B& color);
|
|
|
|
virtual void updateDisplayedColor(const Color3B& parentColor);
|
2013-07-04 12:50:17 +08:00
|
|
|
virtual bool isCascadeColorEnabled() const;
|
2013-04-02 17:52:08 +08:00
|
|
|
virtual void setCascadeColorEnabled(bool cascadeColorEnabled);
|
|
|
|
|
|
|
|
virtual void setOpacityModifyRGB(bool bValue);
|
2013-07-04 12:50:17 +08:00
|
|
|
virtual bool isOpacityModifyRGB() const;
|
2013-04-02 17:52:08 +08:00
|
|
|
};
|