cocos2d-x  2.2.3-gd2.113-rev1ec524e
Loading...
Searching...
No Matches
CCAction Class Reference

Base class for CCAction objects. More...

#include <CCAction.h>

Inheritance diagram for CCAction:
[legend]
Collaboration diagram for CCAction:
[legend]

Public Member Functions

 CCAction (void)
 ctor More...
 
virtual ~CCAction (void)
 NA NA. More...
 
const char * description ()
 NA NA. More...
 
virtual CCObjectcopyWithZone (CCZone *pZone)
 NA NA. More...
 
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)
 
void setSpeedMod (float mod)
 
- Public Member Functions inherited from CCObject
 CCObject (void)
 
virtual ~CCObject (void)
 NA. More...
 
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)
 
virtual void update (float dt)
 
 CCObject (const CCObject &)
 
CCObjectoperator= (const CCObject &)
 
virtual void encodeWithCoder (DS_Dictionary *)
 
virtual bool canEncode ()
 
CCObjectType getObjType () const
 
void setObjType (CCObjectType)
 
virtual CCObjectcopyWithZone (CCZone *pZone)
 

Static Public Member Functions

static CCActioncreate ()
 Create an action. More...
 
- Static Public Member Functions inherited from CCObject
static CCObjectcreateWithCoder (DS_Dictionary *)
 

Protected Attributes

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

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()

CCAction ( void  )

ctor

◆ ~CCAction()

virtual ~CCAction ( void  )
virtual

NA NA.

Member Function Documentation

◆ copyWithZone()

◆ create()

static CCAction * create ( )
static

Create an action.

◆ description()

const char * description ( )

NA NA.

◆ getOriginalTarget()

CCNode * getOriginalTarget ( void  )
inline

◆ getTag()

int getTag ( void  )
inlinevirtual
Remarks
Added by RobTop. See RT_ADD for more info.

Reimplemented from CCObject.

◆ getTarget()

CCNode * getTarget ( void  )
inline

◆ isDone()

virtual bool isDone ( void  )
virtual

return true if the action has finished

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

◆ setOriginalTarget()

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

◆ setSpeedMod()

void setSpeedMod ( float  mod)
Remarks
Added by RobTop. See RT_ADD for more info.

◆ setTag()

void setTag ( int  nTag)
inlinevirtual
Remarks
Added by RobTop. See RT_ADD for more info.

Reimplemented from CCObject.

◆ setTarget()

void setTarget ( CCNode pTarget)
inline

The action will modify the target properties.

◆ startWithTarget()

◆ step()

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 CCSpeed, CCFollow, CCActionInstant, CCActionInterval, and CCRepeatForever.

◆ stop()

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 CCSpeed, CCBlink, CCFollow, CCActionEase, CCSequence, CCRepeat, CCSpawn, CCReverseTime, CCAnimate, and CCTargetedAction.

◆ update()

Member Data Documentation

◆ m_fSpeedMod

float m_fSpeedMod
protected
Remarks
Added by RobTop. See RT_ADD for more info.

◆ m_nTag

int m_nTag
protected

The action tag.

An identifier of the action

◆ m_pOriginalTarget

CCNode* m_pOriginalTarget
protected

◆ m_pTarget

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: