API 0.9.5
CPAnimation Class Reference

#import <CPAnimation.h>

Inheritance diagram for CPAnimation:

List of all members.

Instance Methods

(CPAnimationCurve) - animationCurve
(void) - animationTimerDidFire:
(float) - currentProgress
(float) - currentValue
(id) - delegate
(CPTimeInterval) - duration
(float) - frameRate
(id) - initWithDuration:animationCurve:
(BOOL) - isAnimating
(void) - setAnimationCurve:
(void) - setCurrentProgress:
(void) - setDelegate:
(void) - setDuration:
(void) - setFrameRate:
(void) - startAnimation
(void) - stopAnimation

Detailed Description

Manages an animation. Contains timing and progress information.

Delegate Methods

-(BOOL)animationShouldStart:(CPAnimation)animation; Called at the beginning of -startAnimation.

Parameters:
animationthe animation that will start
Returns:
YES allows the animation to start. NO stops the animation.

-(void)animationDidEnd:(CPAnimation)animation; Called when an animation has completed.

Parameters:
animationthe animation that completed

-(void)animationDidStop:(CPAnimation)animation; Called when the animation was stopped (before completing).

Parameters:
animationthe animation that was stopped

- (float)animation:(CPAnimation)animation valueForProgress:(float)progress; The value from this method will be returned when CPAnimation's currentValue method is called.

Parameters:
animationthe animation to obtain the curve value for
progressthe current animation progress
Returns:
the curve value

Definition at line 2 of file CPAnimation.h.


Method Documentation

- (CPAnimationCurve) animationCurve

Returns the animation's pace

Definition at line 148 of file CPAnimation.j.

- (void) animationTimerDidFire: (CPTimer aTimer

Definition at line 235 of file CPAnimation.j.

- (float) currentProgress

Returns the animation's progress

Definition at line 292 of file CPAnimation.j.

- (float) currentValue

Returns the animation's timing progress.

Definition at line 300 of file CPAnimation.j.

- (id) delegate

Returns the animation's delegate

Definition at line 198 of file CPAnimation.j.

- (CPTimeInterval) duration

Returns the length of the animation.

Definition at line 169 of file CPAnimation.j.

- (float) frameRate

Returns the desired frame rate.

Definition at line 190 of file CPAnimation.j.

- (id) initWithDuration: (float)  aDuration
animationCurve: (CPAnimationCurve)  anAnimationCurve 

Initializes the animation with a duration and animation curve.

Parameters:
aDurationthe length of the animation
anAnimationCurvedefines the animation's pace
Exceptions:
CPInvalidArgumentExceptionif an invalid animation curve is specified

Definition at line 99 of file CPAnimation.j.

- (BOOL) isAnimating

Returns YES if the animation is running.

Definition at line 275 of file CPAnimation.j.

- (void) setAnimationCurve: (CPAnimationCurve)  anAnimationCurve

Sets the animation's pace.

Parameters:
anAnimationCurvethe animation's pace
Exceptions:
CPInvalidArgumentExceptionif an invalid animation curve is specified

Definition at line 120 of file CPAnimation.j.

- (void) setCurrentProgress: (float)  aProgress

Sets the animation's progress.

Parameters:
aProgressthe animation's progress

Definition at line 284 of file CPAnimation.j.

- (void) setDelegate: (id)  aDelegate

Sets the animation's delegate.

Parameters:
aDelegatethe new delegate

Definition at line 207 of file CPAnimation.j.

- (void) setDuration: (CPTimeInterval)  aDuration

Sets the animation's length.

Parameters:
aDurationthe new animation length
Exceptions:
CPInvalidArgumentExceptionif aDuration is negative

Definition at line 158 of file CPAnimation.j.

- (void) setFrameRate: (float)  frameRate

Sets the animation frame rate. This is not a guaranteed frame rate. 0 means to go as fast as possible.

Parameters:
frameRatethe new desired frame rate
Exceptions:
CPInvalidArgumentExceptionif frameRate is negative

Definition at line 179 of file CPAnimation.j.

- (void) startAnimation

Starts the animation. The method calls -animationShouldStart: on the delegate (if it implements it) to see if the animation should begin.

Reimplemented in CPViewAnimation.

Definition at line 217 of file CPAnimation.j.

- (void) stopAnimation

Stops the animation before it has completed.

Reimplemented in CPViewAnimation.

Definition at line 259 of file CPAnimation.j.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Defines