cocos2d-x
3.3
|
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 |
returns a new action that performs the exactly the reverse action More... | |
virtual ActionInterval * | clone () const override |
returns a clone of action More... | |
Public Member Functions inherited from FiniteTimeAction | |
float | getDuration () const |
get duration in seconds of the action More... | |
void | setDuration (float duration) |
set duration in seconds of the action More... | |
Public Member Functions inherited from Action | |
virtual std::string | description () const |
NA NA More... | |
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) |
virtual | ~Action () |
Public Member Functions inherited from Ref | |
void | retain () |
Retains the ownership. More... | |
void | release () |
Releases the ownership immediately. More... | |
Ref * | autorelease () |
Releases the ownership sometime soon automatically. More... | |
unsigned int | getReferenceCount () const |
Returns the Ref's current reference count. More... | |
virtual | ~Ref () |
NA NA More... | |
Public Member Functions inherited from Clonable | |
virtual | ~Clonable () |
NA NA More... | |
Ref * | copy () const |
returns a copy of the Ref. More... | |
Public Attributes | |
CC_CONSTRUCTOR_ACCESS | __pad0__: bool initWithDuration(float d) |
Public Attributes inherited from FiniteTimeAction | |
CC_CONSTRUCTOR_ACCESS | __pad0__: FiniteTimeAction() : _duration(0) {} virtual ~FiniteTimeAction(){}protected: float _duration |
Public Attributes inherited from Action | |
CC_CONSTRUCTOR_ACCESS | __pad0__: Action() |
Protected Attributes | |
float | _elapsed |
bool | _firstTick |
Protected Attributes inherited from Action | |
Node * | _originalTarget |
Node * | _target |
The "target". More... | |
int | _tag |
The action tag. More... | |
Protected Attributes inherited from Ref | |
unsigned int | _referenceCount |
count of references More... | |
Additional Inherited Members | |
Static Public Attributes inherited from Action | |
static const int | INVALID_TAG = -1 |
Default tag used for all the actions. More... | |
Protected Member Functions inherited from Ref | |
Ref () | |
Constructor. 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);
|
inlineoverridevirtual |
returns a clone of action
Reimplemented from FiniteTimeAction.
Reimplemented in TargetedAction, Animate, ReverseTime, EaseCubicActionInOut, DelayTime, EaseCubicActionOut, EaseCubicActionIn, TintBy, EaseCircleActionInOut, TintTo, EaseCircleActionOut, FadeOut, EaseCircleActionIn, FadeIn, EaseQuinticActionInOut, EaseQuinticActionOut, FadeTo, EaseQuinticActionIn, Blink, EaseQuarticActionInOut, ScaleBy, EaseQuarticActionOut, EaseQuarticActionIn, EaseQuadraticActionInOut, ScaleTo, EaseQuadraticActionOut, BezierTo, EaseQuadraticActionIn, EaseBezierAction, BezierBy, EaseBackInOut, JumpTo, EaseBackOut, EaseBackIn, JumpBy, EaseBounceInOut, SkewBy, EaseBounceOut, SkewTo, EaseBounceIn, MoveTo, EaseBounce, EaseElasticInOut, MoveBy, EaseElasticOut, RotateBy, EaseElasticIn, SplitCols, RotateTo, EaseElastic, SplitRows, EaseSineInOut, Twirl, Spawn, JumpTiles3D, EaseSineOut, Waves, CatmullRomBy, CCBEaseInstant, EaseSineIn, WavesTiles3D, DeccelAmplitude, CCBRotateYTo, CatmullRomTo, RepeatForever, EaseExponentialInOut, Liquid, CCBRotateXTo, TurnOffTiles, EaseExponentialOut, AccelAmplitude, CardinalSplineBy, CCBRotateTo, Shaky3D, FadeOutDownTiles, EaseExponentialIn, Repeat, AccelDeccelAmplitude, FadeOutUpTiles, CardinalSplineTo, Ripple3D, EaseInOut, TiledGrid3DAction, FadeOutBLTiles, EaseOut, Sequence, FadeOutTRTiles, Lens3D, EaseIn, Grid3DAction, FlipY3D, ShuffleTiles, OrbitCamera, EaseRateAction, FlipX3D, ProgressFromTo, ActionTween, Animate3D, ShatteredTiles3D, ActionCamera, Waves3D, PageTurn3D, ActionEase, GridAction, ProgressTo, and ShakyTiles3D.
float getAmplitudeRate | ( | void | ) |
|
inline |
how many seconds had elapsed since the actions started to run.
|
overridevirtual |
return true if the action has finished
Reimplemented from Action.
Reimplemented in RepeatForever, and Repeat.
|
inlineoverridevirtual |
returns a new action that performs the exactly the reverse action
Reimplemented from FiniteTimeAction.
Reimplemented in TargetedAction, Animate, ReverseTime, EaseCubicActionInOut, DelayTime, EaseCubicActionOut, EaseCubicActionIn, TintBy, EaseCircleActionInOut, TintTo, EaseCircleActionOut, FadeOut, EaseCircleActionIn, FadeIn, EaseQuinticActionInOut, EaseQuinticActionOut, FadeTo, EaseQuinticActionIn, Blink, EaseQuarticActionInOut, ScaleBy, EaseQuarticActionOut, EaseQuarticActionIn, EaseQuadraticActionInOut, ScaleTo, EaseQuadraticActionOut, BezierTo, EaseQuadraticActionIn, EaseBezierAction, BezierBy, EaseBackInOut, JumpTo, EaseBackOut, EaseBackIn, JumpBy, EaseBounceInOut, SkewBy, EaseBounceOut, SkewTo, EaseBounceIn, EaseBounce, EaseElasticInOut, MoveBy, EaseElasticOut, RotateBy, EaseElasticIn, RotateTo, EaseElastic, EaseSineInOut, Spawn, EaseSineOut, CatmullRomBy, CCBEaseInstant, EaseSineIn, DeccelAmplitude, CCBRotateYTo, CatmullRomTo, RepeatForever, EaseExponentialInOut, CCBRotateXTo, EaseExponentialOut, AccelAmplitude, CardinalSplineBy, CCBRotateTo, EaseExponentialIn, Repeat, AccelDeccelAmplitude, CardinalSplineTo, EaseInOut, EaseOut, Sequence, EaseIn, EaseRateAction, ProgressFromTo, ActionTween, Animate3D, 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, AccelAmplitude, CCBRotateTo, CardinalSplineBy, Repeat, AccelDeccelAmplitude, CardinalSplineTo, Sequence, ShuffleTiles, OrbitCamera, ProgressFromTo, ActionTween, Animate3D, ActionEase, ActionCamera, 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, and Animate3D.
CC_CONSTRUCTOR_ACCESS __pad0__ |
|
protected |
|
protected |