Class cc.ActionTween

Class Summary
Constructor Attributes Constructor Name and Description
 
cc.ActionTween(duration, key, from, to)
cc.ActionTween cc.ActionTween is an action that lets you update any property of an object.

Method Summary

Class Detail

cc.ActionTween(duration, key, from, to)
cc.ActionTween cc.ActionTween is an action that lets you update any property of an object.
//For example, if you want to modify the "width" property of a target from 200 to 300 in 2 seconds, then:
 var modifyWidth = cc.actionTween(2,"width",200,300)
 target.runAction(modifyWidth);

//Another example: cc.ScaleTo action could be rewriten using cc.PropertyAction:
// scaleA and scaleB are equivalents
var scaleA = cc.scaleTo(2,3);
var scaleB = cc.actionTween(2,"scale",1,3);
Parameters:
{Number} duration
{String} key
{Number} from
{Number} to

Field Detail

<static> {cc.ActionTween} cc.ActionTween.create
Please use cc.actionTween instead. Creates an initializes the action with the property name (key), and the from and to parameters.
Deprecated:
since v3.0
Please use cc.actionTween instead.

Method Detail

  • <static> {cc.ActionTween} cc.ActionTween.clone()
    to copy object with deep copy. returns a clone of action.
    Returns:
    {cc.ActionTween}
  • <static> cc.ActionTween.ctor(duration, key, from, to)
    Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
    Creates an initializes the action with the property name (key), and the from and to parameters.
    Parameters:
    {Number} duration
    {String} key
    {Number} from
    {Number} to
  • <static> {Boolean} cc.ActionTween.initWithDuration(duration, key, from, to)
    initializes the action with the property name (key), and the from and to parameters.
    Parameters:
    {Number} duration
    {String} key
    {Number} from
    {Number} to
    Returns:
    {Boolean}
  • <static> {cc.ActionTween} cc.ActionTween.reverse()
    returns a reversed action.
    Returns:
    {cc.ActionTween}
  • <static> cc.ActionTween.startWithTarget(target)
    Start this tween with target.
    Parameters:
    {cc.ActionTweenDelegate} target
  • <static> cc.ActionTween.update(dt)
    Called once per frame. Time is the number of seconds of a frame interval.
    Parameters:
    {Number} dt