Cocos2d-x  v3.10
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
Action Class Reference

Base class for Action objects. More...

Inherits Ref, and Clonable.

Inherited by FiniteTimeAction, Follow, and Speed.

Public Member Functions

virtual Actionclone () const
 Returns a clone of action. More...
 
virtual Actionreverse () const
 Returns a new action that performs the exactly the reverse action. More...
 
virtual bool isDone () const
 Return true if the action has finished. More...
 
virtual void startWithTarget (Node *target)
 Called before the action start. More...
 
virtual void stop ()
 Called after the action that has finished. More...
 
virtual void step (float dt)
 Called every frame with its delta time, dt in seconds. More...
 
virtual void update (float time)
 Called once per frame. More...
 
NodegetTarget () const
 Return the current target. More...
 
void setTarget (Node *target)
 The setter function for the target property. More...
 
NodegetOriginalTarget () const
 Return the original Target. More...
 
void setOriginalTarget (Node *originalTarget)
 Set the original target, since target can be nil. More...
 
int getTag () const
 Returns a tag that is used to identify the action easily. More...
 
void setTag (int tag)
 Changes the tag that is used to identify the action easily. More...
 
unsigned int getFlags () const
 Returns a flag field that is used to group the actions easily. More...
 
void setFlags (unsigned int flags)
 Returns a flag field that is used to group the actions easily. More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor.
 
- Public Member Functions inherited from Clonable
Refcopy () const
 Returns a copy of the Ref.
 

Static Public Attributes

static const int INVALID_TAG = -1
 Default tag used for all the actions.
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 
bool _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 

Detailed Description

Base class for Action objects.

Member Function Documentation

virtual Action* clone ( ) const
inlinevirtual

Returns a clone of action.

A clone action.

Implements Clonable.

Reimplemented in ActionFloat, TargetedAction, Animate, ReverseTime, DelayTime, TintBy, TintTo, FadeOut, FadeIn, FadeTo, EaseCubicActionInOut, EaseCubicActionOut, Blink, EaseCubicActionIn, ScaleBy, EaseCircleActionInOut, EaseCircleActionOut, EaseCircleActionIn, EaseQuinticActionInOut, ScaleTo, EaseQuinticActionOut, EaseQuinticActionIn, EaseQuarticActionInOut, BezierTo, EaseQuarticActionOut, EaseQuarticActionIn, EaseQuadraticActionInOut, BezierBy, EaseQuadraticActionOut, JumpTo, EaseQuadraticActionIn, EaseBezierAction, JumpBy, EaseBackInOut, SkewBy, EaseBackOut, SkewTo, EaseBackIn, MoveTo, EaseBounceInOut, EaseBounceOut, MoveBy, EaseBounceIn, Twirl, SplitCols, EaseBounce, EaseElasticInOut, RotateBy, SplitRows, EaseElasticOut, Waves, JumpTiles3D, EaseElasticIn, RotateTo, Liquid, WavesTiles3D, EaseElastic, Spawn, EaseSineInOut, ReuseGrid, Follow, Shaky3D, CallFuncN, EaseSineOut, TurnOffTiles, StopGrid, EaseSineIn, CatmullRomBy, DeccelAmplitude, Ripple3D, RepeatForever, CallFunc, EaseExponentialInOut, FadeOutDownTiles, Speed, CatmullRomTo, AccelAmplitude, FadeOutUpTiles, EaseExponentialOut, CardinalSplineBy, FadeOutBLTiles, EaseExponentialIn, Repeat, Place, FiniteTimeAction, AccelDeccelAmplitude, FadeOutTRTiles, Lens3D, EaseInOut, CardinalSplineTo, FlipY, TiledGrid3DAction, EaseOut, Sequence, FlipX, FlipY3D, EaseIn, ShuffleTiles, RemoveSelf, OrbitCamera, Grid3DAction, ToggleVisibility, FlipX3D, EaseRateAction, ActionInterval, ShatteredTiles3D, Animate3D, ActionTween, Hide, LuaCallFunc, ProgressFromTo, Waves3D, Show, PageTurn3D, ShakyTiles3D, ActionCamera, ProgressTo, ActionEase, GridAction, and ActionInstant.

virtual bool isDone ( ) const
virtual

Return true if the action has finished.

Is true if the action has finished.

Reimplemented in TargetedAction, Follow, RepeatForever, Speed, Repeat, ActionInterval, and ActionInstant.

virtual void stop ( )
virtual

Called after the action that has finished.

It will set the 'target' to nil. IMPORTANT: You should never call "Action::stop()" manually. Instead, use: "target->stopAction(action);".

Reimplemented in TargetedAction, Animate, ReverseTime, Blink, Spawn, Follow, Speed, Repeat, Sequence, Animate3D, and ActionEase.

virtual void step ( float  dt)
virtual

Called every frame with its delta time, dt in seconds.

DON'T override unless you know what you are doing.

In seconds.

Reimplemented in Follow, RepeatForever, Speed, Animate3D, ActionInterval, and ActionInstant.

virtual void update ( float  time)
virtual
Node* getTarget ( ) const
inline

Return the current target.

the current target.

void setTarget ( Node target)
inline

The setter function for the target property.

A certain target.

Node* getOriginalTarget ( ) const
inline

Return the original Target.

The original Target.

void setOriginalTarget ( Node originalTarget)
inline

Set the original target, since target can be nil.

The original target is the target that were used to run the action. Unless you are doing something complex, like ActionManager, you should NOT call this method. The target is 'assigned', it is not 'retained'. Is 'assigned', it is not 'retained'.

int getTag ( ) const
inline

Returns a tag that is used to identify the action easily.

A tag.

void setTag ( int  tag)
inline

Changes the tag that is used to identify the action easily.

Used to identify the action easily.

unsigned int getFlags ( ) const
inline

Returns a flag field that is used to group the actions easily.

A tag for group actions

void setFlags ( unsigned int  flags)
inline

Returns a flag field that is used to group the actions easily.

A tag for group actions


The documentation for this class was generated from the following file: