Class cc.Action
Extends
cc.Class.
Defined in: CCAction.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Base class for cc.Action objects.
|
Method Attributes | Method Name and Description |
---|---|
copy()
to copy object with deep copy.
|
|
copyWithZone(zone)
to copy object with deep copy.
|
|
<static> |
cc.Action.create()
Allocates and initializes the action
|
getTag()
|
|
isDone()
return true if the action has finished
|
|
release()
|
|
retain()
Currently JavaScript Bindigns (JSB), in some cases, needs to use retain and release.
|
|
setOriginalTarget(originalTarget)
Set the original target, since target can be nil.
|
|
setTag(tag)
|
|
setTarget(target)
The action will modify the target properties.
|
|
startWithTarget(target)
called before the action start.
|
|
step(dt)
called every frame with it's delta time.
|
|
stop()
called after the action has finished.
|
|
update(time)
called once per frame. |
Method Detail
{object}
copy()
to copy object with deep copy.
- Returns:
- {object}
{object}
copyWithZone(zone)
to copy object with deep copy.
- Parameters:
- {object} zone
- Returns:
- {object}
<static>
{cc.Action}
cc.Action.create()
Allocates and initializes the action
// example var action = cc.Action.create();
- Returns:
- {cc.Action}
{String}
description()
- Returns:
- {String}
{cc.Node}
getOriginalTarget()
- Returns:
- {cc.Node}
{Number}
getTag()
- Returns:
- {Number}
{cc.Node}
getTarget()
- Returns:
- {cc.Node}
{Boolean}
isDone()
return true if the action has finished
- Returns:
- {Boolean}
release()
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'.
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)
- 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(time)
called once per frame. time a value between 0 and 1
For example:
- 0 means that the action just started
- 0.5 means that the action is in the middle
- 1 means that the action is over
- Parameters:
- {Number} time