ccnode

The most popular CCNodes are: CCSceneCCLayerCCSpriteCCMenu.

m_bIgnoreAnchorPointForPosition这个值在node中被初始化为false,也就是不忽略(就要考虑)锚点,也就是说在你设置位置的时候必须考虑锚点。

下面这个链接是关于锚点忽略锚点的比较详细的说明:

http://blog.csdn.net/wayne5ning/article/details/8160506

*******************************************************************************************************************

/** The scale factor of the node. 1.0 is the default scale factor. It modifies the X and Y scale at the same time. */
void setScale(float scale);

*******************************************************************************************************************

CCRect boundingBox(void);

举个例子:

bool ret = CCRect::CCRectContainsPoint(

this->boundingBox() , this->getParent()->convertTouchToNodeSpace( pTouch ));

这个例子的功能是来判定当前的触摸操作是否发生在自己的node对象上。其中pTouch是CCTouch对象的指针,包含了当前触摸事件发生点的坐标。

CCRectContainsPoint这个函数用来判断一个点是否在一个矩形范围内。我们就想用这个函数来判断当前触摸操作的这个点是否在当前node的范围内。

this->boundingBox() 方法获得了当前节点对象在父节点对象下的缩放之后的本地坐标大小,并且是用GL坐标系表示的。

pTouch对象中的坐标是屏幕坐标系,所以必须转换到GL坐标系,再转换到父节点的本地坐标下。好在convertTouchToNodeSpace这个函数一次完成了这两个转换,可以参考该库的源码,其中有具体的计算过程。

所有数据都转换到同一个坐标系下了以后,就可以通过CCRectContainsPoint函数完成最终的判定操作。

*******************************************************************************************************************

// actions

Executes an action, and returns the action that is executed.
The node becomes the action's target.

这里动作只是简单的runaction()和stopaction()。

schedule的四种重载函数也在这里声明。

*******************************************************************************************************************

原文地址:https://www.cnblogs.com/imoon/p/2844781.html