# CCTransition Class Reference

Inherits from | CCScene : CCNode : CCResponder : NSObject
Declared in | CCTransition.h

## Overview

Creates a transition. The transition will replace the outgoing scene, with the incoming scene. Both scenes can be animated during the transition ( default disabled ).

Complex animated scenes on retina devices might run slow during transitions. In that case, try disabling retina transitions, and check if the render quality is adequate.

## Tasks

### Accessing the Transition Attributes

- `outgoingDownScale` property
- `incomingDownScale` property
- `retinaTransition` property
- `transitionPixelFormat` property
- `transitionDepthStencilFormat` property
- `outgoingSceneAnimated` property
- `incomingSceneAnimated` property
- `runTime` property
- `progress` property

### Creating a CCTransition Object

- `+ transitionCrossFadeWithDuration:`
- `+ transitionFadeWithColor:duration:`
- `+ transitionFadeWithDuration:`
- `+ transitionMoveInWithDirection:duration:`
- `+ transitionPushWithDirection:duration:`
- `+ transitionRevealWithDirection:duration:`

## Properties

### incomingDownScale

Will downscale incoming scene. Can be used as an effect, or to decrease render time on complex scenes. Default 1.0.

`@property (nonatomic, assign) float incomingDownScale`

#### Declared In

`CCTransition.h`

### incomingSceneAnimated

Defines whether incoming scene will be animated during transition. Default NO.

`@property (nonatomic, getter=isIncomingSceneAnimated) BOOL incomingSceneAnimated`

#### Declared In

`CCTransition.h`

### outgoingDownScale

Will downscale outgoing scene. Can be used as an effect, or to decrease render time on complex scenes. Default 1.0.

`@property (nonatomic, assign) float outgoingDownScale`

#### Declared In

`CCTransition.h`

### outgoingSceneAnimated

Defines whether outgoing scene will be animated during transition. Default NO.

`@property (nonatomic, getter=isOutgoingSceneAnimated) BOOL outgoingSceneAnimated`

#### Declared In

`CCTransition.h`

### progress

Normalized transition progress.

`@property (nonatomic, readonly) float progress`

#### Declared In

`CCTransition.h`

### retinaTransition

Transition will be performed in retina resolution. Will force outgoingDownScale and incomingDownScale to 1.0 on non retina devices, and 2.0 on retina devices if not set. Default YES.

`@property (nonatomic, getter=isRetinaTransition) BOOL retinaTransition`

#### Declared In

`CCTransition.h`

### runTime

The actual transition runtime in seconds.

`@property (nonatomic, readonly) NSTimeInterval runTime`

#### Declared In

`CCTransition.h`

### transitionDepthStencilFormat

Depth/stencil format used for transition. Default GL_DEPTH24_STENCIL8_OES.

`@property (nonatomic, assign) GLuint transitionDepthStencilFormat`

#### Declared In

`CCTransition.h`

### transitionPixelFormat

Pixel format used for transition. Default CCTexturePixelFormat_RGBA8888.

`@property (nonatomic, assign) CCTexturePixelFormat transitionPixelFormat`

#### Declared In

`CCTransition.h`

## Class Methods

### transitionCrossFadeWithDuration:

Creates a cross fade transition directly from outgoing to incoming scene.

`+ (CCTransition *)transitionCrossFadeWithDuration:(NSTimeInterval)duration`

#### Parameters

duration

  The duration of the transition in seconds.

#### Return Value

The CCTransition Object.

#### Declared In

`CCTransition.h`

### transitionFadeWithColor:duration:

Creates a fade transition from outgoing to incoming scene, through color.

`+ (CCTransition *)transitionFadeWithColor:(CCColor *)color duration:(NSTimeInterval)duration`

#### Parameters

color

  The color to fade through

duration

  The duration of the transition in seconds.

#### Return Value

The CCTransition Object.

#### Declared In

`CCTransition.h`

### transitionFadeWithDuration:

Creates a fade transition from outgoing to incoming scene, through black.

`+ (CCTransition *)transitionFadeWithDuration:(NSTimeInterval)duration`

#### Parameters

duration

  The duration of the transition in seconds.

#### Return Value

The CCTransition Object.

#### Declared In

`CCTransition.h`

### transitionMoveInWithDirection:duration:

Creates a transition where the incoming scene is moved in over the outgoing scene.

`+ (CCTransition *)transitionMoveInWithDirection:(CCTransitionDirection)direction duration:(NSTimeInterval)duration`

#### Parameters

direction

  Direction to move the incoming scene.

duration

  The duration of the transition in seconds.

#### Return Value

The CCTransition Object.

#### Declared In

`CCTransition.h`

### transitionPushWithDirection:duration:

Creates a transition where the incoming scene pushed the outgoing scene out.

`+ (CCTransition *)transitionPushWithDirection:(CCTransitionDirection)direction duration:(NSTimeInterval)duration`

#### Parameters

direction

  Direction to move incoming and outgoing scenes.

duration

  The duration of the transition in seconds.

#### Return Value

The CCTransition Object.

#### Declared In

`CCTransition.h`

### transitionRevealWithDirection:duration:

Creates a transition where the incoming scene is revealed by sliding the outgoing scene out.

`+ (CCTransition *)transitionRevealWithDirection:(CCTransitionDirection)direction duration:(NSTimeInterval)duration`

#### Parameters

direction

  Direction to slide outcoing scene.

duration

  The duration of the transition in seconds.

#### Return Value

The CCTransition Object.

#### Declared In

`CCTransition.h`