Class cc.Speed
- Defined in: CCAction.js
- Extends cc.Action
Constructor Attributes | Constructor Name and Description |
---|---|
cc.Speed(action, speed)
Changes the speed of an action, making it take longer (speed > 1)
or less (speed < 1) time.
|
Method Summary
Class Detail
cc.Speed(action, speed)
Changes the speed of an action, making it take longer (speed > 1)
or less (speed < 1) time.
Useful to simulate 'slow motion' or 'fast forward' effect.
Useful to simulate 'slow motion' or 'fast forward' effect.
- Parameters:
- {cc.ActionInterval} action
- {Number} speed
Field Detail
Please use cc.speed instead.
creates the action.
- Deprecated:
- since v3.0 please use cc.speed() instead.
Method Detail
-
{cc.Speed} clone()to copy object with deep copy. returns a clone of action.
- Returns:
- {cc.Speed}
-
ctor(action, speed)Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
- Parameters:
- {cc.ActionInterval} action
- {Number} speed
-
{cc.ActionInterval} getInnerAction()Get inner Action.
- Returns:
- {cc.ActionInterval}
-
{Number} getSpeed()Gets the current running speed.
Will get a percentage number, compared to the original speed.- Returns:
- {Number}
-
{Boolean} initWithAction(action, speed)initializes the action.
- Parameters:
- {cc.ActionInterval} action
- {Number} speed
- Returns:
- {Boolean}
-
{Boolean} isDone()return true if the action has finished.
- Returns:
- {Boolean}
-
{cc.Speed} reverse()returns a reversed action.
For example:
- The action will be x coordinates of 0 move to 100.
- The reversed action will be x of 100 move to 0. - Will be rewritten- Returns:
- {cc.Speed}
-
setInnerAction(action)Set inner Action.
- Parameters:
- {cc.ActionInterval} action
-
setSpeed(speed)alter the speed of the inner function in runtime.
- Parameters:
- {Number} speed
-
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()Stop the action.