Class cc.Action

Class Summary
Constructor Attributes Constructor Name and Description
 
Base class for cc.Action objects.

Method Summary

Class Detail

cc.Action()
Base class for cc.Action objects.

Field Detail

<static> {cc.Action} cc.Action.create
Please use cc.action instead.
Allocates and initializes the action.
Deprecated:
since v3.0 please use cc.action() instead.
{cc.Node} originalTarget
- The original target of the action.
{Number} tag
- The tag of the action, can be used to find the action.
{cc.Node} target
- The target will be set with the 'startWithTarget' method. When the 'stop' method is called, target will be set to nil.

Method Detail

  • {cc.Action} clone()
    to copy object with deep copy. returns a clone of action.
    Returns:
    {cc.Action}
  • {cc.Action} copy()
    to copy object with deep copy.
    Deprecated:
    since v3.0 please use .clone
    Returns:
    {cc.Action}
  • ctor()
    Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
  • {cc.Node} getOriginalTarget()
    get the original target.
    Returns:
    {cc.Node}
  • {Number} getTag()
    get tag number.
    Returns:
    {Number}
  • {cc.Node} getTarget()
    get the target.
    Returns:
    {cc.Node}
  • {Boolean} isDone()
    return true if the action has finished.
    Returns:
    {Boolean}
  • release()
    Currently JavaScript Bindigns (JSB), in some cases, needs to use retain and release. This is a bug in JSB,
    and the ugly workaround is to use retain/release. So, these 2 methods were added to be compatible with JSB.
    This is a hack, and should be removed once JSB fixes the retain/release bug.
  • retain()
    Currently JavaScript Bindigns (JSB), in some cases, needs to use retain and release. This is a bug in JSB,
    and the ugly workaround is to use retain/release. So, these 2 methods were added to be compatible with JSB.
    This is a hack, and should be removed once JSB fixes the retain/release bug.
  • setOriginalTarget(originalTarget)
    Set the original target, since target can be nil.
    Is the target that were used to run the action.
    Unless you are doing something complex, like cc.ActionManager, you should NOT call this method.
    The target is 'assigned', it is not 'retained'.
    Parameters:
    {cc.Node} originalTarget
  • setTag(tag)
    set tag number.
    Parameters:
    {Number} tag
  • setTarget(target)
    The action will modify the target properties.
    Parameters:
    {cc.Node} target
  • startWithTarget(target)
    called before the action start. It will also set the target.
    Parameters:
    {cc.Node} target
  • step(dt)
    called every frame with it's delta time.
    DON'T override unless you know what you are doing.
    Parameters:
    {Number} dt
  • stop()
    called after the action has finished. It will set the 'target' to nil.
    IMPORTANT: You should never call "action stop" manually. Instead, use: "target.stopAction(action);"
  • update(dt)
    Called once per frame. Time is the number of seconds of a frame interval.
    Parameters:
    {Number} dt