cocos2d-x  2.2.3
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CCAction Class Reference

Base class for CCAction objects. More...

#include <CCAction.h>

Inheritance diagram for CCAction:
CCObject CCCopying CCFiniteTimeAction CCFollow CCSpeed CCActionInstant CCActionInterval CCCallFunc CCFlipX CCFlipY CCHide CCPlace CCRemoveSelf CCReuseGrid CCShow CCStopGrid CCToggleVisibility CCBSetSpriteFrame CCBSoundEffect CCAccelAmplitude CCAccelDeccelAmplitude CCActionCamera CCActionEase CCActionTween CCAnimate CCBezierBy CCBlink CCCardinalSplineTo CCDeccelAmplitude CCDelayTime CCFadeIn CCFadeOut CCFadeTo CCGridAction CCJumpBy CCMoveBy CCProgressFromTo CCProgressTo CCRepeat CCRepeatForever CCReverseTime CCRotateBy CCRotateTo CCScaleTo CCSequence CCSkewTo CCSpawn CCTargetedAction CCTintBy CCTintTo CCBRotateTo CCBRotateXTo CCBRotateYTo

Public Member Functions

 CCAction (void)
virtual ~CCAction (void)
const char * description ()
virtual CCObjectcopyWithZone (CCZone *pZone)
virtual bool isDone (void)
 return true if the action has finished More...
 
virtual void startWithTarget (CCNode *pTarget)
 called before the action start. It will also set the target. More...
 
virtual void stop (void)
 called after the action has finished. More...
 
virtual void step (float dt)
 called every frame with it's delta time. DON'T override unless you know what you are doing. More...
 
virtual void update (float time)
 called once per frame. More...
 
CCNodegetTarget (void)
void setTarget (CCNode *pTarget)
 The action will modify the target properties. More...
 
CCNodegetOriginalTarget (void)
void setOriginalTarget (CCNode *pOriginalTarget)
 Set the original target, since target can be nil. More...
 
int getTag (void)
void setTag (int nTag)
- Public Member Functions inherited from CCObject
 CCObject (void)
virtual ~CCObject (void)
void release (void)
void retain (void)
CCObjectautorelease (void)
CCObjectcopy (void)
bool isSingleReference (void) const
unsigned int retainCount (void) const
virtual bool isEqual (const CCObject *pObject)
virtual void acceptVisitor (CCDataVisitor &visitor)

Static Public Member Functions

static CCActioncreate ()
 Create an action. More...
 

Protected Attributes

CCNodem_pOriginalTarget
CCNodem_pTarget
 The "target". More...
 
int m_nTag
 The action tag. More...
 
- Protected Attributes inherited from CCObject
unsigned int m_uReference
unsigned int m_uAutoReleaseCount

Additional Inherited Members

- Public Attributes inherited from CCObject
unsigned int m_uID
int m_nLuaID

Detailed Description

Base class for CCAction objects.

Constructor & Destructor Documentation

CCAction ( void  )
virtual ~CCAction ( void  )
virtual

Member Function Documentation

virtual CCObject* copyWithZone ( CCZone pZone)
virtual

Reimplemented from CCCopying.

Reimplemented in CCTargetedAction, CCAnimate, CCReverseTime, CCDelayTime, CCTintBy, CCTintTo, CCFadeTo, CCFadeOut, CCFadeIn, CCBlink, CCScaleBy, CCScaleTo, CCBezierTo, CCBezierBy, CCEaseBackInOut, CCEaseBackOut, CCJumpTo, CCEaseBackIn, CCJumpBy, CCCallFuncO, CCEaseBounceInOut, CCEaseBounceOut, CCSkewTo, CCCallFuncND, CCEaseBounceIn, CCMoveTo, CCCallFuncN, CCEaseBounce, CCMoveBy, CCEaseElasticInOut, CCRotateBy, CCEaseElasticOut, CCEaseCubicActionInOut, CCRotateTo, CCEaseElasticIn, CCCallFunc, CCEaseCubicActionOut, CCEaseElastic, CCEaseCubicActionIn, CCSplitCols, CCEaseCircleActionInOut, CCSplitRows, CCEaseSineInOut, CCSpawn, CCPlace, CCTwirl, CCEaseCircleActionOut, CCEaseSineOut, CCJumpTiles3D, CCFollow, CCEaseCircleActionIn, CCFlipY, CCEaseSineIn, CCWaves, CCRepeatForever, CCWavesTiles3D, CCBRotateYTo, CCEaseQuinticActionInOut, CCEaseExponentialInOut, CCBRotateXTo, CCFlipX, CCEaseQuinticActionOut, CCLiquid, CCEaseExponentialOut, CCTurnOffTiles, CCBRotateTo, CCSpeed, CCEaseQuinticActionIn, CCEaseExponentialIn, CCShaky3D, CCBSoundEffect, CCRepeat, CCRemoveSelf, CCEaseQuarticActionInOut, CCEaseInOut, CCBSetSpriteFrame, CCRipple3D, CCToggleVisibility, CCEaseQuarticActionOut, CCCardinalSplineTo, CCEaseOut, CCEaseQuarticActionIn, CCHide, CCEaseIn, CCOrbitCamera, CCLens3D, CCSequence, CCEaseQuadraticActionInOut, CCShuffleTiles, CCEaseRateAction, CCFlipY3D, CCEaseQuadraticActionOut, CCShow, CCFlipX3D, CCActionInterval, CCProgressFromTo, CCEaseQuadraticActionIn, CCShatteredTiles3D, CCActionInstant, CCActionEase, CCWaves3D, CCProgressTo, CCGridAction, CCShakyTiles3D, and CCEaseBezierAction.

static CCAction* create ( )
static

Create an action.

const char* description ( )
CCNode* getOriginalTarget ( void  )
inline
int getTag ( void  )
inline
CCNode* getTarget ( void  )
inline
virtual bool isDone ( void  )
virtual

return true if the action has finished

Reimplemented in CCFollow, CCRepeatForever, CCSpeed, CCRepeat, CCActionInterval, and CCActionInstant.

void setOriginalTarget ( CCNode pOriginalTarget)
inline

Set the original target, since target can be nil.

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

Since
v0.8.2
void setTag ( int  nTag)
inline
void setTarget ( CCNode pTarget)
inline

The action will modify the target properties.

virtual void step ( float  dt)
virtual

called every frame with it's delta time. DON'T override unless you know what you are doing.

Reimplemented in CCFollow, CCRepeatForever, CCSpeed, CCActionInterval, and CCActionInstant.

virtual void stop ( void  )
virtual

called after the action has finished.

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

Reimplemented in CCTargetedAction, CCAnimate, CCReverseTime, CCBlink, CCSpawn, CCFollow, CCSpeed, CCRepeat, CCSequence, and CCActionEase.

virtual void update ( float  time)
virtual

called once per frame.

time a value between 0 and 1

For example:

  • 0 means that the action just started
  • 0.5 means that the action is in the middle
  • 1 means that the action is over

Reimplemented from CCObject.

Reimplemented in CCTargetedAction, CCAnimate, CCReverseTime, CCDelayTime, CCTintBy, CCTintTo, CCFadeTo, CCFadeOut, CCFadeIn, CCBlink, CCScaleTo, CCBezierBy, CCEaseBackInOut, CCEaseBackOut, CCJumpBy, CCEaseBackIn, CCEaseBounceInOut, CCSkewTo, CCEaseBounceOut, CCEaseBounceIn, CCMoveBy, CCEaseElasticInOut, CCRotateBy, CCEaseElasticOut, CCEaseCubicActionInOut, CCRotateTo, CCEaseElasticIn, CCCallFunc, CCEaseCubicActionOut, CCSplitCols, CCEaseCubicActionIn, CCSpawn, CCSplitRows, CCEaseCircleActionInOut, CCEaseSineInOut, CCTwirl, CCPlace, CCEaseCircleActionOut, CCJumpTiles3D, CCEaseSineOut, CCEaseCircleActionIn, CCFlipY, CCBEaseInstant, CCEaseSineIn, CCWaves, CCWavesTiles3D, CCBRotateYTo, CCEaseQuinticActionInOut, CCEaseExponentialInOut, CCBRotateXTo, CCLiquid, CCFlipX, CCEaseQuinticActionOut, CCEaseExponentialOut, CCTurnOffTiles, CCBRotateTo, CCDeccelAmplitude, CCEaseQuinticActionIn, CCShaky3D, CCEaseExponentialIn, CCBSoundEffect, CCRepeat, CCRemoveSelf, CCEaseQuarticActionInOut, CCAccelAmplitude, CCRipple3D, CCEaseInOut, CCBSetSpriteFrame, CCCardinalSplineTo, CCToggleVisibility, CCEaseQuarticActionOut, CCEaseOut, CCAccelDeccelAmplitude, CCFadeOutTRTiles, CCSequence, CCEaseQuarticActionIn, CCOrbitCamera, CCLens3D, CCHide, CCEaseIn, CCEaseQuadraticActionInOut, CCShuffleTiles, CCFlipY3D, CCEaseQuadraticActionOut, CCShow, CCFlipX3D, CCProgressFromTo, CCActionTween, CCShatteredTiles3D, CCEaseQuadraticActionIn, CCActionInstant, CCActionEase, CCWaves3D, CCProgressTo, CCPageTurn3D, CCShakyTiles3D, and CCEaseBezierAction.

Member Data Documentation

int m_nTag
protected

The action tag.

An identifier of the action

CCNode* m_pOriginalTarget
protected
CCNode* m_pTarget
protected

The "target".

The target will be set with the 'startWithTarget' method. When the 'stop' method is called, target will be set to nil. The target is 'assigned', it is not 'retained'.


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