CCActionInterval Class Reference
Inherits from | CCActionFiniteTime : CCAction : NSObject |
---|---|
Conforms to | NSCopying |
Declared in | CCActionInterval.h |
Overview
Abstract base class for interval actions. An interval action is an action that performs its task over a certain period of time.
Most CCActionInterval actions can be reversed or have their speed altered via the CCActionSpeed action.
Moving, Rotating, Scaling a Node
- Moving a node along a straight line or curve:
- Rotating a node:
- Scaling a node:
Animating a Node’s Visual Properties
- Periodically toggle visible property on/off:
- Fading a node in/out/to:
- Colorizing a node:
- Skewing a node:
- Animate the sprite frames of a CCSprite with CCAnimation:
- Animating a CCProgressNode:
Repeating and Reversing Actions
- Repeating an action a specific number of times:
- Reversing an action (if supported by the action):
Creating Sequences of Actions
- Creating a linear sequence of actions:
- CCActionSequence
- Wait for a given time in a CCActionSequence:
- Spawning parallel running actions in a CCActionSequence and continue the sequence when all spawned actions have ended:
Easing the Duration of an Action
- Easing duration of a CCActionInterval:
- CCActionEase
- CCActionEaseBackIn, CCActionEaseBackInOut, CCActionEaseBackOut
- CCActionEaseBounce, CCActionEaseBounceIn, CCActionEaseBounceInOut, CCActionEaseBounceOut
- CCActionEaseElastic, CCActionEaseElasticIn, CCActionEaseElasticInOut, CCActionEaseElasticOut
- CCActionEaseRate, CCActionEaseIn, CCActionEaseInOut, CCActionEaseOut
- CCActionEaseSineIn, CCActionEaseSineInOut, CCActionEaseSineOut
Animating custom float/double Properties
- Tweening any node property (of type float or double):
Other Methods
elapsed
How many seconds had elapsed since the actions started to run.
@property (nonatomic, readonly) CCTime elapsed
Declared In
CCActionInterval.h
Creating a Interval Action
+ actionWithDuration:
Creates and returns an action interval object.
+ (id)actionWithDuration:(CCTime)d
Parameters
d |
Action interval. |
---|
Return Value
The CCActionInterval object.
Declared In
CCActionInterval.h
– initWithDuration:
Initializes and returns an action interval object.
- (id)initWithDuration:(CCTime)d
Parameters
d |
Action interval. |
---|
Return Value
An initialized CCActionInterval Object.
Declared In
CCActionInterval.h
Reversing an Action
– reverse
Returns a reversed action.
- (CCActionInterval *)reverse
Return Value
Created reversed action.
Declared In
CCActionInterval.h
Methods implemented by Subclasses
– isDone
Returns YES if the action has finished.
- (BOOL)isDone
Return Value
Action finished status.
Declared In
CCActionInterval.h