CCClippingNode is a subclass of CCNode. It draws its content (childs) clipped using a stencil. The stencil is an other CCNode that will not be drawn. The clipping is done using the alpha part of the stencil (adjusted with an alphaThreshold).
Class CCClippingNode
#include <Geode/cocos/misc_nodes/CCClippingNode.h>
Examples0
Public static methods2
staticcocos2d::CCClippingNode*create()
Creates and initializes a clipping node without a stencil.
staticcocos2d::CCClippingNode*create(cocos2d::CCNode*pStencil)
Creates and initializes a clipping node with an other node as its stencil. The stencil node will be retained.
Public member functions13
virtualboolinit()
Initializes a clipping node without a stencil.
virtualboolinit(cocos2d::CCNode*pStencil)
Initializes a clipping node with an other node as its stencil. The stencil node will be retained, and its parent will be set to this clipping node.
virtualvoidonEnter()
virtualvoidonEnterTransitionDidFinish()
virtualvoidonExitTransitionDidStart()
virtualvoidonExit()
virtualvoidvisit()
cocos2d::CCNode*getStencil()const
The CCNode to use as a stencil to do the clipping. The stencil node will be retained. This default to nil.
voidsetStencil(cocos2d::CCNode*pStencil)
_::GLfloatgetAlphaThreshold()const
The alpha threshold. The content is drawn only where the stencil have pixel with alpha greater than the alphaThreshold. Should be a float between 0 and 1. This default to 1 (so alpha test is disabled).
voidsetAlphaThreshold(_::GLfloatfAlphaThreshold)
boolisInverted()const
Inverted. If this is set to YES, the stencil is inverted, so the content is drawn where the stencil is NOT drawn. This default to NO.