Class cc.TargetedAction

Class Summary
Constructor Attributes Constructor Name and Description
 
cc.TargetedAction(target, action)

Overrides the target of an action so that it always runs on the target
specified at action creation rather than the one specified by runAction.

Method Summary

Class Detail

cc.TargetedAction(target, action)

Overrides the target of an action so that it always runs on the target
specified at action creation rather than the one specified by runAction.

Parameters:
{cc.Node} target
{cc.FiniteTimeAction} action

Field Detail

<static> {cc.TargetedAction} cc.TargetedAction.create
Please use cc.targetedAction instead Create an action with the specified action and forced target
Deprecated:
since v3.0 please use cc.targetedAction instead.

Method Detail

  • {cc.TargetedAction} clone()
    returns a new clone of the action
    Returns:
    {cc.TargetedAction}
  • ctor(target, action)
    Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
    Create an action with the specified action and forced target.
    Parameters:
    {cc.Node} target
    {cc.FiniteTimeAction} action
  • {cc.Node} getForcedTarget()
    return the target that the action will be forced to run with
    Returns:
    {cc.Node}
  • {Boolean} initWithTarget(target, action)
    Init an action with the specified action and forced target
    Parameters:
    {cc.Node} target
    {cc.FiniteTimeAction} action
    Returns:
    {Boolean}
  • setForcedTarget(forcedTarget)
    set the target that the action will be forced to run with
    Parameters:
    {cc.Node} forcedTarget
  • startWithTarget(target)
    Start the action with target.
    Parameters:
    {cc.Node} target
  • stop()
    stop the action
  • update(dt)
    Called once per frame. Time is the number of seconds of a frame interval.
    Parameters:
    {Number} dt