cocos2d-x  2.1.1

An interval action is an action that takes place within a certain period of time. More...

#include <CCActionInterval.h>

Inheritance diagram for CCActionInterval:
CCFiniteTimeAction CCAction CCObject CCCopying 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

Public Member Functions

float getElapsed (void)
 how many seconds had elapsed since the actions started to run.
 
bool initWithDuration (float d)
 initializes the action
 
virtual bool isDone (void)
 returns true if the action has finished
 
virtual CCObjectcopyWithZone (CCZone *pZone)
 
virtual void step (float dt)
 called every frame with it's delta time. DON'T override unless you know what you are doing.
 
virtual void startWithTarget (CCNode *pTarget)
 called before the action start. It will also set the target.
 
virtual CCActionIntervalreverse (void)
 returns a reversed action
 
void setAmplitudeRate (float amp)
 
float getAmplitudeRate (void)
 
- Public Member Functions inherited from CCFiniteTimeAction
 CCFiniteTimeAction ()
 
virtual ~CCFiniteTimeAction ()
 
float getDuration (void)
 get duration in seconds of the action
 
void setDuration (float duration)
 set duration in seconds of the action
 
- Public Member Functions inherited from CCAction
 CCAction (void)
 
virtual ~CCAction (void)
 
const char * description ()
 
virtual void stop (void)
 called after the action has finished.
 
virtual void update (float time)
 called once per frame.
 
CCNodegetTarget (void)
 
void setTarget (CCNode *pTarget)
 The action will modify the target properties.
 
CCNodegetOriginalTarget (void)
 
void setOriginalTarget (CCNode *pOriginalTarget)
 Set the original target, since target can be nil.
 
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)
 
unsigned int retainCount (void)
 
virtual bool isEqual (const CCObject *pObject)
 

Static Public Member Functions

static CCActionIntervalcreate (float d)
 creates the action
 

Protected Attributes

float m_elapsed
 
bool m_bFirstTick
 
- Protected Attributes inherited from CCFiniteTimeAction
float m_fDuration
 duration in seconds
 
- Protected Attributes inherited from CCAction
CCNodem_pOriginalTarget
 
CCNodem_pTarget
 The "target".
 
int m_nTag
 The action tag.
 
- 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

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 CCActionInterval actions have some interesting properties, like:

  • They can run normally (default)
  • They can run reversed with the reverse method
  • They can run with the time altered with the Accelerate, AccelDeccel and Speed actions.

For example, you can simulate a Ping Pong effect running the action normally and then running it again in Reverse mode.

Example:

CCAction *pingPongAction = CCSequence::actions(action, action->reverse(), NULL);

Member Function Documentation

static CCActionInterval* create ( float  d)
static

creates the action

float getAmplitudeRate ( void  )
float getElapsed ( void  )
inline

how many seconds had elapsed since the actions started to run.

bool initWithDuration ( float  d)

initializes the action

virtual bool isDone ( void  )
virtual

returns true if the action has finished

Reimplemented from CCAction.

Reimplemented in CCRepeatForever, and CCRepeat.

void setAmplitudeRate ( float  amp)
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 from CCAction.

Reimplemented in CCRepeatForever.

Member Data Documentation

bool m_bFirstTick
protected
float m_elapsed
protected

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