|
cocos2d-x
2.1.1
|
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. | |
| bool | initWithDuration (float d) |
| initializes the action | |
| virtual bool | isDone (void) |
| returns true if the action has finished | |
| virtual CCObject * | copyWithZone (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 CCActionInterval * | reverse (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. | |
| CCNode * | getTarget (void) |
| void | setTarget (CCNode *pTarget) |
| The action will modify the target properties. | |
| CCNode * | getOriginalTarget (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) |
| CCObject * | autorelease (void) |
| CCObject * | copy (void) |
| bool | isSingleReference (void) |
| unsigned int | retainCount (void) |
| virtual bool | isEqual (const CCObject *pObject) |
Static Public Member Functions | |
| static CCActionInterval * | create (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 | |
| CCNode * | m_pOriginalTarget |
| CCNode * | m_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
Reimplemented from CCAction.
Reimplemented in CCTargetedAction, CCAnimate, CCReverseTime, CCDelayTime, CCTintBy, CCTintTo, CCFadeTo, CCFadeOut, CCFadeIn, CCBlink, CCScaleBy, CCScaleTo, CCBezierTo, CCEaseBackInOut, CCBezierBy, CCEaseBackOut, CCJumpTo, CCEaseBackIn, CCJumpBy, CCEaseBounceInOut, CCEaseBounceOut, CCEaseBounceIn, CCSkewTo, CCEaseBounce, CCMoveTo, CCEaseElasticInOut, CCMoveBy, CCEaseElasticOut, CCRotateBy, CCEaseElasticIn, CCSplitCols, CCRotateTo, CCEaseElastic, CCSplitRows, CCJumpTiles3D, CCEaseSineInOut, CCTwirl, CCSpawn, CCEaseSineOut, CCWavesTiles3D, CCEaseSineIn, CCWaves, CCEaseExponentialInOut, CCRepeatForever, CCLiquid, CCTurnOffTiles, CCEaseExponentialOut, CCShaky3D, CCEaseExponentialIn, CCBRotateTo, CCEaseInOut, CCRipple3D, CCRepeat, CCEaseOut, CCCardinalSplineTo, CCEaseIn, CCOrbitCamera, CCLens3D, CCSequence, CCShuffleTiles, CCEaseRateAction, CCFlipY3D, CCFlipX3D, CCProgressFromTo, CCShatteredTiles3D, CCActionEase, CCWaves3D, CCProgressTo, CCGridAction, and CCShakyTiles3D.
|
static |
creates the action
| float getAmplitudeRate | ( | void | ) |
|
inline |
how many seconds had elapsed since the actions started to run.
| bool initWithDuration | ( | float | d | ) |
initializes the action
|
virtual |
returns true if the action has finished
Reimplemented from CCAction.
Reimplemented in CCRepeatForever, and CCRepeat.
|
virtual |
returns a reversed action
Reimplemented from CCFiniteTimeAction.
Reimplemented in CCAnimate, CCReverseTime, CCDelayTime, CCTintBy, CCFadeOut, CCFadeIn, CCBlink, CCScaleBy, CCEaseBackInOut, CCBezierBy, CCEaseBackOut, CCEaseBackIn, CCJumpBy, CCEaseBounceInOut, CCSkewBy, CCEaseBounceOut, CCEaseBounceIn, CCEaseBounce, CCEaseElasticInOut, CCMoveBy, CCEaseElasticOut, CCRotateBy, CCEaseElasticIn, CCEaseElastic, CCEaseSineInOut, CCSpawn, CCEaseSineOut, CCEaseSineIn, CCRepeatForever, CCEaseExponentialInOut, CCEaseExponentialOut, CCDeccelAmplitude, CCCardinalSplineBy, CCEaseExponentialIn, CCAccelAmplitude, CCRepeat, CCEaseInOut, CCCardinalSplineTo, CCEaseOut, CCAccelDeccelAmplitude, CCSequence, CCEaseIn, CCEaseRateAction, CCActionTween, CCProgressFromTo, CCActionCamera, CCActionEase, and CCGridAction.
| void setAmplitudeRate | ( | float | amp | ) |
|
virtual |
called before the action start. It will also set the target.
Reimplemented from CCAction.
Reimplemented in CCTargetedAction, CCAnimate, CCReverseTime, CCTintBy, CCTintTo, CCFadeTo, CCBlink, CCScaleBy, CCScaleTo, CCBezierTo, CCBezierBy, CCJumpTo, CCJumpBy, CCSkewBy, CCSkewTo, CCMoveTo, CCMoveBy, CCRotateBy, CCSplitCols, CCRotateTo, CCSplitRows, CCSpawn, CCRepeatForever, CCTurnOffTiles, CCDeccelAmplitude, CCCardinalSplineBy, CCAccelAmplitude, CCBRotateTo, CCRepeat, CCCardinalSplineTo, CCAccelDeccelAmplitude, CCOrbitCamera, CCSequence, CCShuffleTiles, CCProgressFromTo, CCActionTween, CCActionCamera, CCActionEase, CCProgressTo, and CCGridAction.
|
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
|
protected |
|
protected |
The documentation for this class was generated from the following file:
- /Users/zhangkoumyou/SourceCode/cocos2d-x/cocos2dx/actions/CCActionInterval.h

Public Member Functions inherited from 