Class cc.ActionInterval
- Defined in: CCActionInterval.js
- Extends cc.FiniteTimeAction
Constructor Attributes | Constructor Name and Description |
---|---|
An interval action is an action that takes place within a certain period of time. |
Method Summary
Class Detail
cc.ActionInterval(d)
An interval action is an action that takes place within a certain period of time.
It has an start time, and a finish time. The finish time is the parameter
duration plus the start time.
These CCActionInterval actions have some interesting properties, like:
- They can run normally (default)
- They can run reversed with the reverse method
- They can run with the time altered with the Accelerate, AccelDeccel and Speed actions.
For example, you can simulate a Ping Pong effect running the action normally and
then running it again in Reverse mode.
var actionInterval = new cc.ActionInterval(3);
- Parameters:
- {Number} d
- duration in seconds
Field Detail
Please use cc.actionInterval instead.
An interval action is an action that takes place within a certain period of time.
- Deprecated:
-
since v3.0
Please use cc.actionInterval instead.
Method Detail
-
{cc.ActionInterval} clone()Returns a new clone of the action.
- Returns:
- {cc.ActionInterval}
-
ctor(d)Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
- Parameters:
- {Number} d
- duration in seconds
-
{cc.ActionInterval} easing(easeObj)Implementation of ease motion.
//example action.easeing(cc.easeIn(3.0));
- Parameters:
- {Object} easeObj
- Returns:
- {cc.ActionInterval}
-
{Number} getAmplitudeRate()Get amplitude rate.
- Returns:
- {Number} 0
-
{Number} getElapsed()How many seconds had elapsed since the actions started to run.
- Returns:
- {Number}
-
{Number} getSpeed()Get this action speed.
- Returns:
- {Number}
-
{Boolean} initWithDuration(d)Initializes the action.
- Parameters:
- {Number} d
- duration in seconds
- Returns:
- {Boolean}
-
{Boolean} isDone()Returns true if the action has finished.
- Returns:
- {Boolean}
-
{cc.ActionInterval} repeat(times)Repeats an action a number of times. To repeat an action forever use the CCRepeatForever action.
- Parameters:
- times
- Returns:
- {cc.ActionInterval}
-
{cc.ActionInterval} repeatForever()Repeats an action for ever.
To repeat the an action for a limited number of times use the Repeat action.
- Returns:
- {cc.ActionInterval}
-
{null} reverse()returns a reversed action.
Will be overwrite.- Returns:
- {null}
-
setAmplitudeRate(amp)Set amplitude rate.
- Parameters:
- {Number} amp
-
{cc.ActionInterval} setSpeed(speed)Set this action speed.
- Parameters:
- {Number} speed
- Returns:
- {cc.ActionInterval}
-
{cc.Action} speed(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.- Parameters:
- speed
- Returns:
- {cc.Action}
-
startWithTarget(target)Start this action with 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