cocos2d-iphone  2.1
Improved Cocos2D API Reference (iOS version) for www.kobold2d.com developers
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Defines
CCClippingNode Class Reference

#import <CCClippingNode.h>

+ Inheritance diagram for CCClippingNode:
+ Collaboration diagram for CCClippingNode:

List of all members.

Public Member Functions

(id) - init
(id) - initWithStencil:

Static Public Member Functions

(id) + clippingNode
(id) + clippingNodeWithStencil:

Protected Attributes

CCNode_stencil
GLfloat _alphaThreshold
BOOL _inverted

Properties

CCNodestencil
GLfloat alphaThreshold
BOOL inverted

Detailed Description

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).


Member Function Documentation

+ (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) init

Initializes a clipping node without a stencil.

Implements CCNode.

- (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.


Property Documentation

- (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.

- (CCNode*) stencil [read, write, retain]

The CCNode to use as a stencil to do the clipping. The stencil node will be retained. This default to nil.


The documentation for this class was generated from the following file: