cocos2d-x  3.3rc0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ActionObject Class Reference

#include <CCActionObject.h>

Inheritance diagram for ActionObject:
Ref

Public Member Functions

 ActionObject ()
virtual ~ActionObject ()
 Default destructor. More...
 
void setName (const char *name)
 Sets name for object. More...
 
const char * getName ()
 Gets name of object. More...
 
void setLoop (bool bLoop)
 Sets if the action will loop play. More...
 
bool getLoop ()
 Gets if the action will loop play. More...
 
void setUnitTime (float fTime)
 Sets the time interval of frame. More...
 
float getUnitTime ()
 Gets the time interval of frame. More...
 
void setCurrentTime (float fTime)
 Sets the current time of frame. More...
 
float getCurrentTime ()
 Gets the current time of frame. More...
 
float getTotalTime ()
 Gets the total time of frame. More...
 
bool isPlaying ()
 Return if the action is playing. More...
 
void play ()
 Play the action. More...
 
void play (cocos2d::CallFunc *func)
 Play the action. More...
 
void pause ()
 Pause the action. More...
 
void stop ()
 Stop the action. More...
 
void addActionNode (ActionNode *node)
 Adds a ActionNode to play the action. More...
 
void removeActionNode (ActionNode *node)
 Removes a ActionNode which play the action. More...
 
void updateToFrameByTime (float fTime)
void initWithDictionary (const rapidjson::Value &dic, cocos2d::Ref *root)
void initWithBinary (CocoLoader *cocoLoader, stExpCocoNode *pCocoNode, cocos2d::Ref *root)
void simulationActionUpdate (float dt)
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
local getReferenceCount ()
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()

Protected Member Functions

int valueToInt (const std::string &value)
bool valueToBool (const std::string &value)
float valueToFloat (const std::string &value)
- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 
 Ref ()
 Constructor. More...
 

Protected Attributes

cocos2d::Vector< ActionNode * > _actionNodeList
std::string _name
bool _loop
bool _bPause
bool _bPlaying
float _fUnitTime
float _currentTime
cocos2d::Scheduler_pScheduler
cocos2d::CallFunc_CallBack
float _fTotalTime
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 
local _referenceCount
 count of references More...
 

Constructor & Destructor Documentation

virtual ~ActionObject ( )
virtual

Default destructor.

Member Function Documentation

void addActionNode ( ActionNode node)

Adds a ActionNode to play the action.

Parameters
nodethe ActionNode which will play the action
float getCurrentTime ( )

Gets the current time of frame.

Returns
the current time of frame
bool getLoop ( )

Gets if the action will loop play.

Returns
that if the action will loop play
const char* getName ( )

Gets name of object.

Returns
name of object
float getTotalTime ( )

Gets the total time of frame.

Returns
the total time of frame
float getUnitTime ( )

Gets the time interval of frame.

Returns
the time interval of frame
void initWithBinary ( CocoLoader cocoLoader,
stExpCocoNode pCocoNode,
cocos2d::Ref root 
)
void initWithDictionary ( const rapidjson::Value &  dic,
cocos2d::Ref root 
)
bool isPlaying ( )

Return if the action is playing.

Returns
true if the action is playing, false the otherwise
void pause ( )

Pause the action.

void play ( )

Play the action.

void play ( cocos2d::CallFunc func)

Play the action.

Parameters
funcAction Call Back
void removeActionNode ( ActionNode node)

Removes a ActionNode which play the action.

Parameters
nodethe ActionNode which play the action
void setCurrentTime ( float  fTime)

Sets the current time of frame.

Parameters
fTimethe current time of frame
void setLoop ( bool  bLoop)

Sets if the action will loop play.

Parameters
bLoopthat if the action will loop play
void setName ( const char *  name)

Sets name for object.

Parameters
namename of object
void setUnitTime ( float  fTime)

Sets the time interval of frame.

Parameters
fTimethe time interval of frame
void simulationActionUpdate ( float  dt)
void stop ( )

Stop the action.

void updateToFrameByTime ( float  fTime)
bool valueToBool ( const std::string &  value)
protected
float valueToFloat ( const std::string &  value)
protected
int valueToInt ( const std::string &  value)
protected

Member Data Documentation

cocos2d::Vector<ActionNode*>
_actionNodeList
protected
bool _bPause
protected
bool _bPlaying
protected
cocos2d::CallFunc* _CallBack
protected
float _currentTime
protected
float _fTotalTime
protected
float _fUnitTime
protected
bool _loop
protected
std::string _name
protected
cocos2d::Scheduler* _pScheduler
protected

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