Inherits from CCNode : NSObject
Declared in CCClippingNode.h

Overview

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

Tasks

  •   stencil

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

    property
  •   alphaThreshold

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

    property
  •   inverted

    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.

    property
  • + clippingNode

    Creates and initializes a clipping node without a stencil.

  • + clippingNodeWithStencil:

    Creates and initializes a clipping node with an other node as its stencil. The stencil node will be retained.

  • – init

    Initializes a clipping node without a stencil.

  • – initWithStencil:

    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.

Properties

alphaThreshold

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

@property (nonatomic) GLfloat alphaThreshold

Declared In

CCClippingNode.h

inverted

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.

@property (nonatomic) BOOL inverted

Declared In

CCClippingNode.h

stencil

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

@property (nonatomic, retain) CCNode *stencil

Declared In

CCClippingNode.h

Class Methods

clippingNode

Creates and initializes a clipping node without a stencil.

+ (id)clippingNode

Declared In

CCClippingNode.h

clippingNodeWithStencil:

Creates and initializes a clipping node with an other node as its stencil. The stencil node will be retained.

+ (id)clippingNodeWithStencil:(CCNode *)stencil

Declared In

CCClippingNode.h

Instance Methods

init

Initializes a clipping node without a stencil.

- (id)init

Declared In

CCClippingNode.h

initWithStencil:

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.

- (id)initWithStencil:(CCNode *)stencil

Declared In

CCClippingNode.h