Class cc.ActionTween
Extends
cc.ActionInterval.
Defined in: CCActionTween.js.
Constructor Attributes | Constructor Name and Description |
---|---|
cc.ActionTween
cc.ActionTween is an action that lets you update any property of an object.
|
Method Attributes | Method Name and Description |
---|---|
<static> |
cc.ActionTween.create(duration, key, from, to)
Creates an initializes the action with the property name (key), and the from and to parameters.
|
<static> |
cc.ActionTween.initWithDuration(duration, key, from, to)
initializes the action with the property name (key), and the from and to parameters.
|
<static> |
cc.ActionTween.reverse()
|
<static> |
cc.ActionTween.startWithTarget(target)
|
<static> |
cc.ActionTween.update(dt)
|
- Methods borrowed from class cc.ActionInterval:
- getAmplitudeRate, getElapsed, isDone, setAmplitudeRate, step
- Methods borrowed from class cc.FiniteTimeAction:
- getDuration, setDuration
- Methods borrowed from class cc.Action:
- copy, copyWithZone, description, getOriginalTarget, getTag, getTarget, release, retain, setOriginalTarget, setTag, setTarget, stop
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
<static>
{cc.ActionTween}
cc.ActionTween.create(duration, key, from, to)
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}
<static>
{cc.ActionTween}
cc.ActionTween.reverse()
- Returns:
- {cc.ActionTween}
<static>
cc.ActionTween.startWithTarget(target)
- Parameters:
- {cc.Node} target
<static>
cc.ActionTween.update(dt)
- Parameters:
- {Number} dt