Class cc.ActionTween
- Defined in: CCActionTween.js
- Extends cc.ActionInterval
Constructor Attributes | Constructor Name and Description |
---|---|
cc.ActionTween
cc.ActionTween is an action that lets you update any property of an object.
|
Method Summary
Class Detail
cc.ActionTween()
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.create(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.create(2,3); var scaleB = cc.ActionTween.create(2,"scale",1,3);
Method Detail
-
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
- Returns:
- {cc.ActionTween}
-
<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}
-
- Returns:
- {cc.ActionTween}
-
<static> cc.ActionTween.startWithTarget(target)
- Parameters:
- {cc.Node} target
-
<static> cc.ActionTween.update(dt)
- Parameters:
- {Number} dt