An interval action is an action that takes place within a certain period of time. More...
#include <CCActionInterval.h>
Public Member Functions | |
float | getElapsed (void) |
how many seconds had elapsed since the actions started to run. More... | |
void | setAmplitudeRate (float amp) |
float | getAmplitudeRate (void) |
virtual bool | isDone (void) const override |
return true if the action has finished More... | |
virtual void | step (float dt) override |
called every frame with it's delta time. DON'T override unless you know what you are doing. More... | |
virtual void | startWithTarget (Node *target) override |
called before the action start. It will also set the target. More... | |
virtual ActionInterval * | reverse () const override=0 |
returns a new action that performs the exactly the reverse action More... | |
virtual ActionInterval * | clone () const override=0 |
returns a clone of action More... | |
![]() | |
float | getDuration () const |
get duration in seconds of the action More... | |
void | setDuration (float duration) |
set duration in seconds of the action More... | |
![]() | |
virtual std::string | description () const |
virtual void | stop () |
called after the action has finished. More... | |
virtual void | update (float time) |
called once per frame. More... | |
Node * | getTarget () const |
void | setTarget (Node *target) |
The action will modify the target properties. More... | |
Node * | getOriginalTarget () const |
void | setOriginalTarget (Node *originalTarget) |
Set the original target, since target can be nil. More... | |
int | getTag () const |
void | setTag (int tag) |
![]() | |
void | retain () |
Retains the ownership. More... | |
void | release () |
Release the ownership immediately. More... | |
Ref * | autorelease () |
Release the ownership sometime soon automatically. More... | |
unsigned int | getReferenceCount () const |
Returns the Ref's current reference count. More... | |
virtual | ~Ref () |
![]() | |
virtual | ~Clonable () |
Ref * | copy () const |
returns a copy of the Ref. More... | |
Protected Member Functions | |
bool | initWithDuration (float d) |
initializes the action More... | |
![]() | |
FiniteTimeAction () | |
virtual | ~FiniteTimeAction () |
![]() | |
Action () | |
virtual | ~Action () |
![]() | |
Ref () | |
Constructor. More... | |
Protected Attributes | |
float | _elapsed |
bool | _firstTick |
![]() | |
float | _duration |
duration in seconds More... | |
![]() | |
Node * | _originalTarget |
Node * | _target |
The "target". More... | |
int | _tag |
The action tag. More... | |
![]() | |
unsigned int | _referenceCount |
count of references More... | |
Additional Inherited Members | |
![]() | |
static const int | INVALID_TAG = -1 |
Default tag used for all the actions. More... | |
An interval action is an action that takes place within a certain period of time.
It has an start time, and a finish time. The finish time is the parameter duration plus the start time.
These ActionInterval actions have some interesting properties, like:
For example, you can simulate a Ping Pong effect running the action normally and then running it again in Reverse mode.
Example:
Action *pingPongAction = Sequence::actions(action, action->reverse(), nullptr);
|
overridepure virtual |
returns a clone of action
Implements FiniteTimeAction.
Implemented in TargetedAction, Animate, ReverseTime, DelayTime, EaseCubicActionInOut, EaseCubicActionOut, TintBy, EaseCubicActionIn, TintTo, EaseCircleActionInOut, FadeOut, EaseCircleActionOut, EaseCircleActionIn, FadeIn, EaseQuinticActionInOut, FadeTo, EaseQuinticActionOut, EaseQuinticActionIn, Blink, EaseQuarticActionInOut, ScaleBy, EaseQuarticActionOut, EaseQuarticActionIn, ScaleTo, EaseQuadraticActionInOut, BezierTo, EaseQuadraticActionOut, EaseQuadraticActionIn, BezierBy, EaseBezierAction, JumpTo, EaseBackInOut, EaseBackOut, JumpBy, EaseBackIn, SkewBy, EaseBounceInOut, SkewTo, EaseBounceOut, EaseBounceIn, MoveTo, EaseBounce, MoveBy, EaseElasticInOut, EaseElasticOut, RotateBy, SplitCols, EaseElasticIn, RotateTo, SplitRows, EaseElastic, Twirl, JumpTiles3D, Spawn, EaseSineInOut, EaseSineOut, Waves, CatmullRomBy, WavesTiles3D, CCBEaseInstant, CCBRotateYTo, EaseSineIn, CatmullRomTo, DeccelAmplitude, Liquid, RepeatForever, CCBRotateXTo, TurnOffTiles, EaseExponentialInOut, CardinalSplineBy, CCBRotateTo, AccelAmplitude, Shaky3D, FadeOutDownTiles, EaseExponentialOut, FadeOutUpTiles, EaseExponentialIn, CardinalSplineTo, Repeat, Ripple3D, AccelDeccelAmplitude, FadeOutBLTiles, EaseInOut, TiledGrid3DAction, FadeOutTRTiles, EaseOut, Lens3D, Sequence, EaseIn, Grid3DAction, FlipY3D, ShuffleTiles, OrbitCamera, EaseRateAction, FlipX3D, ProgressFromTo, ActionTween, ShatteredTiles3D, ActionCamera, Waves3D, PageTurn3D, ActionEase, GridAction, ProgressTo, and ShakyTiles3D.
float getAmplitudeRate | ( | void | ) |
|
inline |
how many seconds had elapsed since the actions started to run.
|
protected |
initializes the action
|
overridevirtual |
return true if the action has finished
Reimplemented from Action.
Reimplemented in RepeatForever, and Repeat.
|
overridepure virtual |
returns a new action that performs the exactly the reverse action
Implements FiniteTimeAction.
Implemented in TargetedAction, Animate, ReverseTime, DelayTime, EaseCubicActionInOut, EaseCubicActionOut, TintBy, EaseCubicActionIn, TintTo, EaseCircleActionInOut, FadeOut, EaseCircleActionOut, EaseCircleActionIn, FadeIn, EaseQuinticActionInOut, FadeTo, EaseQuinticActionOut, EaseQuinticActionIn, Blink, EaseQuarticActionInOut, ScaleBy, EaseQuarticActionOut, EaseQuarticActionIn, ScaleTo, EaseQuadraticActionInOut, BezierTo, EaseQuadraticActionOut, EaseQuadraticActionIn, BezierBy, EaseBezierAction, JumpTo, EaseBackInOut, EaseBackOut, JumpBy, EaseBackIn, SkewBy, EaseBounceInOut, SkewTo, EaseBounceOut, EaseBounceIn, EaseBounce, MoveBy, EaseElasticInOut, EaseElasticOut, RotateBy, EaseElasticIn, RotateTo, EaseElastic, Spawn, EaseSineInOut, EaseSineOut, CatmullRomBy, CCBEaseInstant, CCBRotateYTo, EaseSineIn, CatmullRomTo, DeccelAmplitude, RepeatForever, CCBRotateXTo, EaseExponentialInOut, CardinalSplineBy, CCBRotateTo, AccelAmplitude, EaseExponentialOut, EaseExponentialIn, CardinalSplineTo, Repeat, AccelDeccelAmplitude, EaseInOut, EaseOut, Sequence, EaseIn, EaseRateAction, ProgressFromTo, ActionTween, ActionCamera, ActionEase, GridAction, and ProgressTo.
void setAmplitudeRate | ( | float | amp) |
|
overridevirtual |
called before the action start. It will also set the target.
Reimplemented from Action.
Reimplemented in TargetedAction, Animate, ReverseTime, TintBy, TintTo, FadeOut, FadeIn, FadeTo, Blink, ScaleBy, ScaleTo, BezierTo, BezierBy, JumpTo, JumpBy, SkewBy, SkewTo, MoveTo, MoveBy, RotateBy, SplitCols, RotateTo, SplitRows, Spawn, CCBRotateYTo, DeccelAmplitude, RepeatForever, TurnOffTiles, CCBRotateXTo, CCBRotateTo, CardinalSplineBy, AccelAmplitude, CardinalSplineTo, Repeat, AccelDeccelAmplitude, Sequence, ShuffleTiles, OrbitCamera, ProgressFromTo, ActionTween, ActionCamera, ActionEase, GridAction, and ProgressTo.
|
overridevirtual |
called every frame with it's delta time. DON'T override unless you know what you are doing.
Reimplemented from Action.
Reimplemented in RepeatForever.
|
protected |
|
protected |