CPObjectCPAnimation
@implementation CPAnimation : CPObject
Manages an animation. Contains timing and progress information.
Method Summary | |
---|---|
-(id) | initWithDuration:(float)aDuration animationCurve:(CPAnimationCurve)anAnimationCurve Initializes the animation with a duration and animation curve. |
-(CPAnimationCurve) | animationCurve Returns the animation's pace. |
-(float) | currentProgress Returns the animation's progress. |
-(float) | currentValue Returns the animation's timing progress. |
-(id) | delegate Returns the animation's delegate. |
-(CPTimeInterval) | duration Returns the length of the animation. |
-(float) | frameRate Returns the desired frame rate. |
-(BOOL) | isAnimating Returns YES if the animation
is running. |
-(void) | setAnimationCurve:(CPAnimationCurve)anAnimationCurve Sets the animation's pace. |
-(void) | setCurrentProgress:(float)aProgress Sets the animation's progress. |
-(void) | setDelegate:(id)aDelegate Sets the animation's delegate. |
-(void) | setDuration:(CPTimeInterval)aDuration Sets the animation's length. |
-(void) | setFrameRate:(float)frameRate Sets the animation frame rate. |
-(void) | startAnimation Starts the animation. |
-(void) | stopAnimation Stops the animation before it has completed. |
Delegate Method Summary | |
---|---|
-(BOOL) | animationShouldStart:(CPAnimation)animation Called at the beginning of startAnimation . |
-(void) | animationDidEnd:(CPAnimation)animation Called when an animation has completed. |
-(void) | animationDidStop:(CPAnimation)animation Called when the animation was stopped (before completing). |
-(float) | animation:(CPAnimation)animation valueForProgress:(float)progress The value from this method will be returned when CPAnimation 's
currentValue method is called. |
Method Detail |
---|
-(id)initWithDuration:(float)aDuration animationCurve:(CPAnimationCurve)anAnimationCurve
aDuration
- the length of the animationanAnimationCurve
- defines the animation's paceCPInvalidArgumentException
- if an invalid animation curve is specified-(CPAnimationCurve)animationCurve
-(float)currentProgress
-(float)currentValue
-(id)delegate
-(CPTimeInterval)duration
-(float)frameRate
-(BOOL)isAnimating
YES
if the animation
is running.-(void)setAnimationCurve:(CPAnimationCurve)anAnimationCurve
anAnimationCurve
- the animation's paceCPInvalidArgumentException
- if an invalid animation curve is specified-(void)setCurrentProgress:(float)aProgress
aProgress
- the animation's progress-(void)setDelegate:(id)aDelegate
aDelegate
- the new delegate-(void)setDuration:(CPTimeInterval)aDuration
aDuration
- the new animation lengthCPInvalidArgumentException
- if aDuration
is negative-(void)setFrameRate:(float)frameRate
frameRate
- the new desired frame rateCPInvalidArgumentException
- if frameRate
is negative-(void)startAnimation
animationShouldStart:
on the delegate (if it implements it) to see if the animation
should begin.-(void)stopAnimation
Delegate Method Detail |
---|
-(BOOL)animationShouldStart:(CPAnimation)animation
startAnimation
.animation
- the animation that will startYES
allows the animation to start.
NO
stops the animation.
-(void)animationDidEnd:(CPAnimation)animation
animation
- the animation that completed-(void)animationDidStop:(CPAnimation)animation
animation
- the animation that was stopped-(float)animation:(CPAnimation)animation valueForProgress:(float)progress
CPAnimation
's
currentValue
method is called.animation
- the animation to obtain the curve value forprogress
- the current animation progressCreated on Sat Sep 13 14:15:43 PDT 2008