ActionManager is a singleton that manages all the actions. More...
#include <CCActionManager.h>
Public Member Functions | |
ActionManager (void) | |
ctor () | |
ActionManager () | |
~ActionManager (void) | |
void | addAction (Action *action, Node *target, bool paused) |
Adds an action with a target. More... | |
void | removeAllActions () |
Removes all actions from all the targets. More... | |
void | removeAllActionsFromTarget (Node *target) |
Removes all actions from a certain target. More... | |
local | removeAllActionsFromTarget ( local target) |
Removes all actions from a certain target. More... | |
void | removeAction (Action *action) |
Removes an action given an action reference. More... | |
local | removeAction ( local action) |
Removes an action given an action reference. More... | |
void | removeActionByTag (int tag, Node *target) |
Removes an action given its tag and the target. More... | |
var | removeActionByTag ( var tag, var target) |
Removes an action given its tag and the target. More... | |
local | removeActionByTag ( local tag, local target) |
Removes an action given its tag and the target. More... | |
void | removeAllActionsByTag (int tag, Node *target) |
Removes all actions given its tag and the target. More... | |
Action * | getActionByTag (int tag, const Node *target) const |
Gets an action given its tag an a target. More... | |
ssize_t | getNumberOfRunningActionsInTarget (const Node *target) const |
Returns the numbers of actions that are running in a certain target. More... | |
ssize_t | numberOfRunningActionsInTarget (Node *target) const |
local | numberOfRunningActionsInTarget ( local target) |
void | pauseTarget (Node *target) |
Pauses the target: all running actions and newly added actions will be paused. More... | |
void | resumeTarget (Node *target) |
Resumes the target. More... | |
Vector< Node * > | pauseAllRunningActions () |
Pauses all running actions, returning a list of targets whose actions were paused. More... | |
var | pauseAllRunningActions () |
Pauses all running actions, returning a list of targets whose actions were paused. More... | |
local | pauseAllRunningActions () |
Pauses all running actions, returning a list of targets whose actions were paused. More... | |
void | resumeTargets (const Vector< Node * > &targetsToResume) |
Resume a set of targets (convenience function to reverse a pauseAllRunningActions call). More... | |
var | resumeTargets ( var targetsToResume) |
Resume a set of targets (convenience function to reverse a pauseAllRunningActions call). More... | |
local | resumeTargets ( local targetsToResume) |
Resume a set of targets (convenience function to reverse a pauseAllRunningActions call). More... | |
void | update (float dt) |
Main loop of ActionManager. More... | |
![]() | |
void | retain () |
Retains the ownership. More... | |
void | release () |
Releases the ownership immediately. More... | |
Ref * | autorelease () |
Releases the ownership sometime soon automatically. More... | |
unsigned int | getReferenceCount () const |
Returns the Ref's current reference count. More... | |
virtual | ~Ref () |
Destructor. More... | |
Protected Member Functions | |
void | removeActionAtIndex (ssize_t index, struct _hashElement *element) |
local | removeActionAtIndex ( local index, local element) |
void | deleteHashElement (struct _hashElement *element) |
local | deleteHashElement ( local element) |
void | actionAllocWithHashElement (struct _hashElement *element) |
local | actionAllocWithHashElement ( local element) |
![]() | |
Ref () | |
Constructor. More... | |
Ref () | |
Constructor. More... | |
Protected Attributes | |
struct _hashElement * | _targets |
struct _hashElement * | _currentTarget |
var | _currentTarget |
local | _currentTarget |
bool | _currentTargetSalvaged |
var | _currentTargetSalvaged |
local | _currentTargetSalvaged |
![]() | |
unsigned int | _referenceCount |
count of references More... | |
local | _referenceCount |
count of references More... | |
ActionManager is a singleton that manages all the actions.
Normally you won't need to use this singleton directly. 99% of the cases you will use the Node interface, which uses this singleton. But there are some cases where you might need to use this singleton. Examples:
ActionManager | ( | void | ) |
var ctor | ( | ) |
local ActionManager | ( | ) |
~ActionManager | ( | void | ) |
|
protected |
|
protected |
|
protected |
Adds an action with a target.
If the target is already present, then the action will be added to the existing target. If the target is not present, a new instance of this target will be created either paused or not, and the action will be added to the newly created target. When the target is paused, the queued actions won't be 'ticked'.
action | A certain action. |
target | The target which need to be added an action. |
paused | Is the target paused or not. |
var addAction | ( | var | action, |
var | target, | ||
var | paused | ||
) |
Adds an action with a target.
If the target is already present, then the action will be added to the existing target. If the target is not present, a new instance of this target will be created either paused or not, and the action will be added to the newly created target. When the target is paused, the queued actions won't be 'ticked'.
action | A certain action. |
target | The target which need to be added an action. |
paused | Is the target paused or not. |
local addAction | ( | local | action, |
local | target, | ||
local | paused | ||
) |
Adds an action with a target.
If the target is already present, then the action will be added to the existing target. If the target is not present, a new instance of this target will be created either paused or not, and the action will be added to the newly created target. When the target is paused, the queued actions won't be 'ticked'.
action | A certain action. |
target | The target which need to be added an action. |
paused | Is the target paused or not. |
|
protected |
|
protected |
|
protected |
Gets an action given its tag an a target.
tag | The action's tag. |
target | A certain target. |
var getActionByTag | ( | var | tag, |
var | target | ||
) |
Gets an action given its tag an a target.
tag | The action's tag. |
target | A certain target. |
local getActionByTag | ( | local | tag, |
local | target | ||
) |
Gets an action given its tag an a target.
tag | The action's tag. |
target | A certain target. |
Returns the numbers of actions that are running in a certain target.
Composable actions are counted as 1 action. Example:
target | A certain target. |
local getNumberOfRunningActionsInTarget |
( | local | target | ) |
Returns the numbers of actions that are running in a certain target.
Composable actions are counted as 1 action. Example:
target | A certain target. |
|
inline |
|
inline |
Pauses all running actions, returning a list of targets whose actions were paused.
var pauseAllRunningActions | ( | ) |
Pauses all running actions, returning a list of targets whose actions were paused.
local pauseAllRunningActions | ( | ) |
Pauses all running actions, returning a list of targets whose actions were paused.
void pauseTarget | ( | Node * | target | ) |
Pauses the target: all running actions and newly added actions will be paused.
target | A certain target. |
var pauseTarget | ( | var | target | ) |
Pauses the target: all running actions and newly added actions will be paused.
target | A certain target. |
local pauseTarget | ( | local | target | ) |
Pauses the target: all running actions and newly added actions will be paused.
target | A certain target. |
void removeAction | ( | Action * | action | ) |
Removes an action given an action reference.
action | A certain target. |
var removeAction | ( | var | action | ) |
Removes an action given an action reference.
action | A certain target. |
local removeAction | ( | local | action | ) |
Removes an action given an action reference.
action | A certain target. |
|
protected |
|
protected |
|
protected |
void removeActionByTag | ( | int | tag, |
Node * | target | ||
) |
Removes an action given its tag and the target.
tag | The action's tag. |
target | A certain target. |
var removeActionByTag | ( | var | tag, |
var | target | ||
) |
Removes an action given its tag and the target.
tag | The action's tag. |
target | A certain target. |
local removeActionByTag | ( | local | tag, |
local | target | ||
) |
Removes an action given its tag and the target.
tag | The action's tag. |
target | A certain target. |
void removeAllActions | ( | ) |
Removes all actions from all the targets.
var removeAllActions | ( | ) |
Removes all actions from all the targets.
local removeAllActions | ( | ) |
Removes all actions from all the targets.
void removeAllActionsByTag | ( | int | tag, |
Node * | target | ||
) |
Removes all actions given its tag and the target.
tag | The actions' tag. |
target | A certain target. |
local removeAllActionsByTag | ( | local | tag, |
local | target | ||
) |
Removes all actions given its tag and the target.
tag | The actions' tag. |
target | A certain target. |
void removeAllActionsFromTarget | ( | Node * | target | ) |
Removes all actions from a certain target.
All the actions that belongs to the target will be removed.
target | A certain target. |
var removeAllActionsFromTarget | ( | var | target | ) |
Removes all actions from a certain target.
All the actions that belongs to the target will be removed.
target | A certain target. |
local removeAllActionsFromTarget | ( | local | target | ) |
Removes all actions from a certain target.
All the actions that belongs to the target will be removed.
target | A certain target. |
void resumeTarget | ( | Node * | target | ) |
Resumes the target.
All queued actions will be resumed.
target | A certain target. |
var resumeTarget | ( | var | target | ) |
Resumes the target.
All queued actions will be resumed.
target | A certain target. |
local resumeTarget | ( | local | target | ) |
Resumes the target.
All queued actions will be resumed.
target | A certain target. |
Resume a set of targets (convenience function to reverse a pauseAllRunningActions call).
targetsToResume | A set of targets need to be resumed. |
var resumeTargets | ( | var | targetsToResume | ) |
Resume a set of targets (convenience function to reverse a pauseAllRunningActions call).
targetsToResume | A set of targets need to be resumed. |
local resumeTargets | ( | local | targetsToResume | ) |
Resume a set of targets (convenience function to reverse a pauseAllRunningActions call).
targetsToResume | A set of targets need to be resumed. |
void update | ( | float | dt | ) |
Main loop of ActionManager.
dt | In seconds. |
var update | ( | var | dt | ) |
Main loop of ActionManager.
dt | In seconds. |
local update | ( | local | dt | ) |
Main loop of ActionManager.
dt | In seconds. |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |