![]() |
cocos2d-iphone
2.1
Improved Cocos2D API Reference (iOS version) for www.kobold2d.com developers
|
#import <CCClippingNode.h>
Public Member Functions | |
(id) | - init |
(id) | - initWithStencil: |
Static Public Member Functions | |
(id) | + clippingNode |
(id) | + clippingNodeWithStencil: |
Protected Attributes | |
CCNode * | _stencil |
GLfloat | _alphaThreshold |
BOOL | _inverted |
Properties | |
CCNode * | stencil |
GLfloat | alphaThreshold |
BOOL | inverted |
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).
+ (id) clippingNode |
Creates and initializes a clipping node without a stencil.
+ (id) clippingNodeWithStencil: | (CCNode *) | stencil |
Creates and initializes a clipping node with an other node as its stencil. The stencil node will be retained.
- (id) initWithStencil: | (CCNode *) | stencil |
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.
- (GLfloat) alphaThreshold [read, write, assign] |
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).
- (BOOL) inverted [read, write, assign] |
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.
The CCNode to use as a stencil to do the clipping. The stencil node will be retained. This default to nil.