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

#include <CCActionTimeline.h>

Inheritance diagram for ActionTimeline:
CCAction CCObject CCCopying

Public Member Functions

 ActionTimeline ()
virtual ~ActionTimeline ()
virtual bool init ()
virtual void gotoFrameAndPlay (int startIndex)
 Goto the specified frame index, and start playing from this index. More...
 
virtual void gotoFrameAndPlay (int startIndex, bool loop)
 Goto the specified frame index, and start playing from this index. More...
 
virtual void gotoFrameAndPlay (int startIndex, int endIndex, bool loop)
 Goto the specified frame index, and start playing from start index, end at end index. More...
 
virtual void gotoFrameAndPlay (int startIndex, int endIndex, int currentFrameIndex, bool loop)
 Goto the specified frame index, and start playing from start index, end at end index. More...
 
virtual void gotoFrameAndPause (int startIndex)
 Goto the specified frame index, and pause at this index. More...
 
virtual void pause ()
 Pause the animation. More...
 
virtual void resume ()
 Resume the animation. More...
 
virtual bool isPlaying () const
 Whether or not Action is playing. More...
 
virtual void setTimeSpeed (float speed)
 Set the animation speed, this will speed up or slow down the speed. More...
 
virtual float getTimeSpeed () const
 Get current animation speed. More...
 
virtual void setDuration (int duration)
 duration of the whole action More...
 
virtual int getDuration () const
virtual int getStartFrame () const
 Start frame index of this action. More...
 
virtual int getEndFrame () const
 End frame of this action. More...
 
virtual void setCurrentFrame (int frameIndex)
 Set current frame index, this will cause action plays to this frame. More...
 
virtual int getCurrentFrame () const
 Get current frame. More...
 
virtual void addTimeline (Timeline *timeline)
 add Timeline to ActionTimeline More...
 
virtual void removeTimeline (Timeline *timeline)
void setFrameEventCallFunc (CCObject *target, SEL_TimelineFrameEventCallFunc callFunc)
 Set action's frame event callback function. More...
 
void clearFrameEventCallFunc ()
virtual ActionTimelineclone () const
 Inherit from cocos2d::Action. More...
 
virtual ActionTimelinereverse () const
 Returns a reverse of ActionTimeline. More...
 
virtual void step (float delta)
 called every frame with it's delta time. DON'T override unless you know what you are doing. More...
 
virtual void startWithTarget (cocos2d::CCNode *target)
 called before the action start. It will also set the target. More...
 
virtual bool isDone ()
 return true if the action has finished More...
 
virtual cocos2d::CCDictionarygetScriptObjectDict () const
 Returns a user assigned CCDictionary. More...
 
virtual void setScriptObjectDict (cocos2d::CCDictionary *scriptObjectDict)
 Returns a user assigned CCDictionary. More...
 
- Public Member Functions inherited from CCAction
 CCAction (void)
virtual ~CCAction (void)
const char * description ()
virtual CCObjectcopyWithZone (CCZone *pZone)
virtual void stop (void)
 called after the action has finished. 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 ActionTimelinecreate ()
- Static Public Member Functions inherited from CCAction
static CCActioncreate ()
 Create an action. More...
 

Protected Member Functions

void foreachNodeDescendant (cocos2d::CCNode *parent)
virtual void gotoFrame (int frameIndex)
virtual void stepToFrame (int frameIndex)
void emitFrameEvent (Frame *frame)
 emit frame event, call it when enter a frame More...
 

Protected Attributes

std::map< int, cocos2d::CCArray * > _timelineMap
cocos2d::CCArray_timelineList
int _duration
double _time
float _timeSpeed
float _frameInternal
bool _playing
int _currentFrame
int _startFrame
int _endFrame
bool _loop
SEL_TimelineFrameEventCallFunc _frameEventCallFunc
cocos2d::CCObject_frameEventTarget
cocos2d::CCDictionary_scriptObjectDict
- Protected Attributes inherited from CCAction
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

Friends

class Frame

Additional Inherited Members

- Public Attributes inherited from CCObject
unsigned int m_uID
int m_nLuaID

Constructor & Destructor Documentation

virtual ~ActionTimeline ( )
virtual

Member Function Documentation

virtual void addTimeline ( Timeline timeline)
virtual
void clearFrameEventCallFunc ( )
virtual ActionTimeline* clone ( ) const
virtual

Inherit from cocos2d::Action.

Returns a clone of ActionTimeline

static ActionTimeline* create ( )
static
void emitFrameEvent ( Frame frame)
protected

emit frame event, call it when enter a frame

void foreachNodeDescendant ( cocos2d::CCNode parent)
protected
virtual int getCurrentFrame ( ) const
inlinevirtual

Get current frame.

virtual int getDuration ( ) const
inlinevirtual
virtual int getEndFrame ( ) const
inlinevirtual

End frame of this action.

When action play to this frame, if action is not loop, then it will stop, or it will play from start frame again.

virtual cocos2d::CCDictionary*
getScriptObjectDict
( ) const
virtual

Returns a user assigned CCDictionary.

Returns
A user assigned CCDictionary
virtual int getStartFrame ( ) const
inlinevirtual

Start frame index of this action.

virtual float getTimeSpeed ( ) const
inlinevirtual

Get current animation speed.

virtual void gotoFrame ( int  frameIndex)
protectedvirtual
virtual void gotoFrameAndPause ( int  startIndex)
virtual

Goto the specified frame index, and pause at this index.

Parameters
startIndexThe animation will pause at this index.
virtual void gotoFrameAndPlay ( int  startIndex)
virtual

Goto the specified frame index, and start playing from this index.

Parameters
startIndexThe animation will play from this index.
virtual void gotoFrameAndPlay ( int  startIndex,
bool  loop 
)
virtual

Goto the specified frame index, and start playing from this index.

Parameters
startIndexThe animation will play from this index.
loopWhether or not the animation need loop.
virtual void gotoFrameAndPlay ( int  startIndex,
int  endIndex,
bool  loop 
)
virtual

Goto the specified frame index, and start playing from start index, end at end index.

Parameters
startIndexThe animation will play from this index.
endIndexThe animation will end at this index.
loopWhether or not the animation need loop.
virtual void gotoFrameAndPlay ( int  startIndex,
int  endIndex,
int  currentFrameIndex,
bool  loop 
)
virtual

Goto the specified frame index, and start playing from start index, end at end index.

Parameters
startIndexThe animation will play from this index.
endIndexThe animation will end at this index.
currentFrameIndexset current frame index.
loopWhether or not the animation need loop.
virtual bool init ( )
virtual
virtual bool isDone ( )
inlinevirtual

return true if the action has finished

Reimplemented from CCAction.

virtual bool isPlaying ( ) const
virtual

Whether or not Action is playing.

virtual void pause ( )
virtual

Pause the animation.

virtual void removeTimeline ( Timeline timeline)
virtual
virtual void resume ( )
virtual

Resume the animation.

virtual ActionTimeline* reverse ( ) const
inlinevirtual

Returns a reverse of ActionTimeline.

Not implement yet.

virtual void setCurrentFrame ( int  frameIndex)
virtual

Set current frame index, this will cause action plays to this frame.

virtual void setDuration ( int  duration)
inlinevirtual

duration of the whole action

void setFrameEventCallFunc ( CCObject target,
SEL_TimelineFrameEventCallFunc  callFunc 
)

Set action's frame event callback function.

virtual void setScriptObjectDict ( cocos2d::CCDictionary scriptObjectDict)
virtual

Returns a user assigned CCDictionary.

The scriptObjectDict will be retained once in this method, and the previous scriptObjectDict (if existed) will be relese. The scriptObjectDict will be released in destructure.

Parameters
Auser assigned CCObject
virtual void setTimeSpeed ( float  speed)
inlinevirtual

Set the animation speed, this will speed up or slow down the speed.

virtual void startWithTarget ( cocos2d::CCNode pTarget)
virtual

called before the action start. It will also set the target.

Reimplemented from CCAction.

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.

virtual void stepToFrame ( int  frameIndex)
protectedvirtual

Friends And Related Function Documentation

friend class Frame
friend

Member Data Documentation

int _currentFrame
protected
int _duration
protected
int _endFrame
protected
SEL_TimelineFrameEventCallFunc
_frameEventCallFunc
protected
cocos2d::CCObject*
_frameEventTarget
protected
float _frameInternal
protected
bool _loop
protected
bool _playing
protected
cocos2d::CCDictionary*
_scriptObjectDict
protected
int _startFrame
protected
double _time
protected
cocos2d::CCArray* _timelineList
protected
std::map<int, cocos2d::CCArray*>
_timelineMap
protected
float _timeSpeed
protected

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