# CCClippingNode Class Reference

Inherits from | CCNode : CCResponder : NSObject
Declared in | CCClippingNode.h

## Overview

CCClippingNode can be used to clip (crop) your node content using a stencil.

### Notes

- 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).
- Alpha threshold, content is only drawn where the stencil has pixels with alpha greater than the alpha threshold. (Default 1 disable alpha test)
- Inverted, when True only draw the content outside of the stencil. (Default False)

## Tasks

### Accessing Clipping Node Attributes

- `stencil` property
- `alphaThreshold` property
- `inverted` property

### Creating a CCClippingNode Object

- `+ clippingNode`
- `+ clippingNodeWithStencil:`

### Initializing a CCClippingNode Object

- `– init`
- `– initWithStencil:`

## Properties

### alphaThreshold

The Alpha threshold.

`@property (nonatomic) GLfloat alphaThreshold`

#### Declared In

`CCClippingNode.h`

### inverted

Inverted.

`@property (nonatomic) BOOL inverted`

#### Declared In

`CCClippingNode.h`

### stencil

Stencil Node.

`@property (nonatomic, strong) CCNode *stencil`

#### Declared In

`CCClippingNode.h`

## Class Methods

### clippingNode

Creates and returns a clipping node object without a stencil.

`+ (id)clippingNode`

#### Return Value

The CCClippingNode Object.

#### Declared In

`CCClippingNode.h`

### clippingNodeWithStencil:

Creates and returns a clipping node object with the specified stencil node.

`+ (id)clippingNodeWithStencil:(CCNode *)stencil`

#### Parameters

stencil

  Node to use as stencil.

#### Return Value

The CCClippingNode Object.

#### Declared In

`CCClippingNode.h`

## Instance Methods

### init

Initializes and returns a clipping node object without a stencil.

`- (id)init`

#### Return Value

An initialized CCClippingNode Object.

#### Declared In

`CCClippingNode.h`

### initWithStencil:

Initializes and returns a clipping node object with the specified stencil node.

`- (id)initWithStencil:(CCNode *)stencil`

#### Parameters

stencil

  Node to use as stencil.

#### Return Value

An initialized CCClippingNode Object.

#### Declared In

`CCClippingNode.h`