ActionManager is a singleton that manages all the actions.
More...
#include <ActionManager.h>
Inherits Object.
|
| ActionManager () |
| @js ctor
|
|
virtual | ~ActionManager () |
| @js NA @lua NA
|
|
virtual void | addAction (Action *action, Node *target, bool paused) |
| Adds an action with a target.
|
|
virtual void | removeAllActions () |
| Removes all actions from all the targets.
|
|
virtual void | removeAllActionsFromTarget (Node *target) |
| Removes all actions from a certain target.
|
|
virtual void | removeAction (Action *action) |
| Removes an action given an action reference.
|
|
virtual void | removeActionByTag (int tag, Node *target) |
| Removes an action given its tag and the target.
|
|
virtual void | removeAllActionsByTag (int tag, Node *target) |
| Removes all actions given its tag and the target.
|
|
virtual void | removeActionsByFlags (unsigned int flags, Node *target) |
| Removes all actions matching at least one bit in flags and the target.
|
|
virtual Action * | getActionByTag (int tag, const Node *target) const |
| Gets an action given its tag an a target.
|
|
virtual ssize_t | getNumberOfRunningActionsInTarget (const Node *target) const |
| Returns the numbers of actions that are running in a certain target.
|
|
virtual ssize_t | getNumberOfRunningActions () const |
| Returns the numbers of actions that are running in all targets.
|
|
virtual size_t | getNumberOfRunningActionsInTargetByTag (const Node *target, int tag) |
| Returns the numbers of actions that are running in a certain target with a specific tag.
|
|
virtual void | pauseTarget (Node *target) |
| Pauses the target: all running actions and newly added actions will be paused.
|
|
virtual void | resumeTarget (Node *target) |
| Resumes the target.
|
|
virtual Vector< Node * > | pauseAllRunningActions () |
| Pauses all running actions, returning a list of targets whose actions were paused.
|
|
virtual void | resumeTargets (const Vector< Node * > &targetsToResume) |
| Resume a set of targets (convenience function to reverse a pauseAllRunningActions call).
|
|
virtual void | update (float dt) |
| Main loop of ActionManager.
|
|
void | retain () |
| Retains the ownership.
|
|
void | release () |
| Releases the ownership immediately.
|
|
Object * | autorelease () |
| Releases the ownership sometime soon automatically.
|
|
unsigned int | getReferenceCount () const |
| Returns the Object's current reference count.
|
|
virtual | ~Object () |
| Destructor.
|
|
|
unsigned int | _ID |
| object id, ScriptSupport need public _ID
|
|
int | _luaID |
| Lua reference id.
|
|
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:
- When you want to run an action where the target is different from a Node.
- When you want to pause / resume the actions.
- Since
- v0.8
◆ addAction()
virtual void addAction |
( |
Action * | action, |
|
|
Node * | target, |
|
|
bool | paused ) |
|
virtual |
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'.
- Parameters
-
action | A certain action. |
target | The target which need to be added an action. |
paused | Is the target paused or not. |
◆ removeAllActionsFromTarget()
virtual void removeAllActionsFromTarget |
( |
Node * | target | ) |
|
|
virtual |
Removes all actions from a certain target.
All the actions that belongs to the target will be removed.
- Parameters
-
◆ removeAction()
virtual void removeAction |
( |
Action * | action | ) |
|
|
virtual |
Removes an action given an action reference.
- Parameters
-
◆ removeActionByTag()
virtual void removeActionByTag |
( |
int | tag, |
|
|
Node * | target ) |
|
virtual |
Removes an action given its tag and the target.
- Parameters
-
tag | The action's tag. |
target | A certain target. |
◆ removeAllActionsByTag()
virtual void removeAllActionsByTag |
( |
int | tag, |
|
|
Node * | target ) |
|
virtual |
Removes all actions given its tag and the target.
- Parameters
-
tag | The actions' tag. |
target | A certain target. @js NA |
◆ removeActionsByFlags()
virtual void removeActionsByFlags |
( |
unsigned int | flags, |
|
|
Node * | target ) |
|
virtual |
Removes all actions matching at least one bit in flags and the target.
- Parameters
-
flags | The flag field to match the actions' flags based on bitwise AND. |
target | A certain target. @js NA |
◆ getActionByTag()
virtual Action * getActionByTag |
( |
int | tag, |
|
|
const Node * | target ) const |
|
virtual |
Gets an action given its tag an a target.
- Parameters
-
tag | The action's tag. |
target | A certain target. |
- Returns
- The Action the with the given tag.
◆ getNumberOfRunningActionsInTarget()
virtual ssize_t getNumberOfRunningActionsInTarget |
( |
const Node * | target | ) |
const |
|
virtual |
Returns the numbers of actions that are running in a certain target.
Composable actions are counted as 1 action. Example:
- If you are running 1 Sequence of 7 actions, it will return 1.
- If you are running 7 Sequences of 2 actions, it will return 7.
- Parameters
-
- Returns
- The numbers of actions that are running in a certain target. @js NA
◆ getNumberOfRunningActions()
virtual ssize_t getNumberOfRunningActions |
( |
| ) |
const |
|
virtual |
Returns the numbers of actions that are running in all targets.
- Returns
- The numbers of actions that are running in all target. @js NA
◆ getNumberOfRunningActionsInTargetByTag()
virtual size_t getNumberOfRunningActionsInTargetByTag |
( |
const Node * | target, |
|
|
int | tag ) |
|
virtual |
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:
- If you are running 1 Sequence of 7 actions, it will return 1.
- If you are running 7 Sequences of 2 actions, it will return 7.
- Parameters
-
target | A certain target. |
tag | Tag that will be searched. |
- Returns
- The numbers of actions that are running in a certain target with a specific tag.
- See also
- getNumberOfRunningActionsInTarget @js NA
◆ pauseTarget()
virtual void pauseTarget |
( |
Node * | target | ) |
|
|
virtual |
Pauses the target: all running actions and newly added actions will be paused.
- Parameters
-
◆ resumeTarget()
virtual void resumeTarget |
( |
Node * | target | ) |
|
|
virtual |
Resumes the target.
All queued actions will be resumed.
- Parameters
-
◆ pauseAllRunningActions()
virtual Vector< Node * > pauseAllRunningActions |
( |
| ) |
|
|
virtual |
Pauses all running actions, returning a list of targets whose actions were paused.
- Returns
- A list of targets whose actions were paused.
◆ resumeTargets()
virtual void resumeTargets |
( |
const Vector< Node * > & | targetsToResume | ) |
|
|
virtual |
Resume a set of targets (convenience function to reverse a pauseAllRunningActions call).
- Parameters
-
targetsToResume | A set of targets need to be resumed. |
◆ update()
virtual void update |
( |
float | dt | ) |
|
|
virtual |
The documentation for this class was generated from the following file: