ActionManager is a singleton that manages all the actions. More...
Public Member Functions | |
ActionManager (void) | |
ctor | |
~ActionManager (void) | |
NA NA | |
void | addAction (Action *action, Node *target, bool paused) |
Adds an action with a target. More... | |
void | removeAllActions () |
Removes all actions from all the targets. | |
void | removeAllActionsFromTarget (Node *target) |
Removes all actions from a certain target. More... | |
void | removeAction (Action *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... | |
void | removeAllActionsByTag (int tag, Node *target) |
Removes all actions given its tag and the target. More... | |
void | removeActionsByFlags (unsigned int flags, Node *target) |
Removes all actions matching at least one bit in flags 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 |
size_t | getNumberOfRunningActionsInTargetByTag (const Node *target, int tag) |
Returns the numbers of actions that are running in a certain target with a specific tag. More... | |
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... | |
void | resumeTargets (const Vector< Node *> &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... | |
Additional Inherited Members | |
![]() | |
unsigned int | _ID |
object id, ScriptSupport need public _ID | |
int | _luaID |
Lua reference id. | |
void * | _scriptObject |
scriptObject, support for swift | |
bool | _rooted |
When true, it means that the object was already rooted. | |
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:
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. |
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. |
void removeAction | ( | Action * | action | ) |
Removes an action given an action reference.
action | A certain target. |
void removeActionByTag | ( | int | tag, |
Node * | target | ||
) |
Removes an action given its tag and the target.
tag | The action's tag. |
target | A certain target. |
void removeAllActionsByTag | ( | int | tag, |
Node * | target | ||
) |
Removes all actions given its tag and the target.
tag | The actions' tag. |
target | A certain target. NA |
void removeActionsByFlags | ( | unsigned int | flags, |
Node * | target | ||
) |
Removes all actions matching at least one bit in flags and the target.
flags | The flag field to match the actions' flags based on bitwise AND. |
target | A certain target. NA |
Gets an action given its tag an a target.
tag | The action's tag. |
target | A certain target. |
ssize_t getNumberOfRunningActionsInTarget | ( | const Node * | target | ) | const |
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 |
size_t getNumberOfRunningActionsInTargetByTag | ( | const Node * | target, |
int | tag | ||
) |
Returns the numbers of actions that are running in a certain target with a specific tag.
Like getNumberOfRunningActionsInTarget Composable actions are counted as 1 action. Example:
target | A certain target. |
tag | Tag that will be searched. |
void pauseTarget | ( | Node * | target | ) |
Pauses the target: all running actions and newly added actions will be paused.
target | A certain target. |
void resumeTarget | ( | Node * | target | ) |
Resumes the target.
All queued actions will be resumed.
target | A certain target. |
Vector<Node*> pauseAllRunningActions | ( | ) |
Pauses all running actions, returning a list of targets whose actions were paused.
void resumeTargets | ( | const Vector< Node *> & | 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. |