源码:
/**
* @addtogroup _2d
* @{
*/
/** ClippingNode is a subclass of Node.
* It draws its content (childs) clipped using a stencil.
* The stencil is an other Node that will not be drawn.
* The clipping is done using the alpha part of the stencil (adjusted with an alphaThreshold).
*/
/// 裁剪节点是节点的一个子类
// 他通过一个模板来裁剪其子节点
/// 这个模板是另一个将被绘制的节点
/// 使用模板的alpha通道裁剪
class CC_DLL ClippingNode : public Node
{
public:
/** Creates and initializes a clipping node without a stencil.
*
* @return An autorelease ClippingNode.
*/
/// 创建一个裁剪节点
static ClippingNode* create();
/** Creates and initializes a clipping node with an other node as its stencil.
* The stencil node will be retained.
* @param stencil The stencil node.
*/
/// 通过一个模板创建一个裁剪节点
static ClippingNode* create(Node *stencil);
/** The Node to use as a stencil to do the clipping.
* The stencil node will be retained.
* This default to nil.
*
* @return The stencil node.
*/
/// 得到模板
Node* getStencil() const;
/** Set the Node to use as a stencil to do the clipping.
*
* @param stencil The Node to use as a stencil to do the clipping.
*/
/// 设置模板
void setStencil(Node *stencil);
/** If stencil has no childre it