# CCEffectStack Class Reference

Inherits from | CCEffect : NSObject
Declared in | CCEffectStack.h

## Overview

CCEffectStack allows multiple effects to be stacked together to form interesting visual combinations. Effect stacks are immutable in the sense that the effects they contain cannot be changed once the stack is created. However, the parameters of the contained effects can be changed.

## Tasks

### Accessing Stack Attributes

- `effectCount` property

### Initializing a CCEffectStack object

- `– init`
- `– initWithArray:`
- `– initWithEffects:`

### Creating a CCEffectStack object

- `+ effectWithArray:`
- `+ effects:`

### Accessing Contained Effects

- `– effectAtIndex:`

## Properties

### effectCount

The number of effects contained in the stack.

`@property (nonatomic, readonly) NSUInteger effectCount`

#### Declared In

`CCEffectStack.h`

## Class Methods

### effectWithArray:

Creates an effect stack object with the specified array of effects.

`+ (id)effectWithArray:(NSArray *)arrayOfEffects`

#### Parameters

arrayOfEffects

  The array of effects to add to the stack.

#### Return Value

The CCEffectStack object.

#### Declared In

`CCEffectStack.h`

### effects:

Creates an effect stack object with the specified effects.

`+ (id)effects:(CCEffect *)effect1, ...`

#### Parameters

effect1

  First effect to add to the stack.

...

  Nil terminated list of effects to stack.

#### Return Value

The CCEffectStack object.

#### Declared In

`CCEffectStack.h`

## Instance Methods

### effectAtIndex:

Retrieve a contained effect.

`- (CCEffect *)effectAtIndex:(NSUInteger)effectIndex`

#### Parameters

effectIndex

  The index of the effect object to retrieve.

#### Return Value

The selected effect object.

#### Declared In

`CCEffectStack.h`

### init

Initializes an empty effect stack object.

`- (id)init`

#### Return Value

The CCEffectStack object.

#### Declared In

`CCEffectStack.h`

### initWithArray:

Initializes an effect stack object with the specified array of effects.

`- (id)initWithArray:(NSArray *)arrayOfEffects`

#### Parameters

arrayOfEffects

  The array of effects to add to the stack.

#### Return Value

The CCEffectStack object.

#### Declared In

`CCEffectStack.h`

### initWithEffects:

Initializes an effect stack object with the specified effects.

`- (id)initWithEffects:(CCEffect *)effect1, ...`

#### Parameters

effect1

  First effect to add to the stack.

...

  Nil terminated list of effects to stack.

#### Return Value

The CCEffectStack object.

#### Declared In

`CCEffectStack.h`