Class cc.ActionInterval

Class Summary
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()

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.

Method Detail

  • {cc.ActionInterval} clone()
    returns a new clone of the action
    Returns:
    {cc.ActionInterval}
  • <static> {cc.ActionInterval} cc.ActionInterval.create(d)
    // example
    var actionInterval = cc.ActionInterval.create(3);
    Parameters:
    {Number} d
    duration in seconds
    Returns:
    {cc.ActionInterval}
  • {Number} getAmplitudeRate()
    Returns:
    {Number}
  • {Number} getElapsed()
    how many seconds had elapsed since the actions started to run.
    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}
  • {Null} reverse()
    Returns:
    {Null}
  • setAmplitudeRate(amp)
    Parameters:
    {Number} amp
  • startWithTarget(target)
    Parameters:
    {cc.Node} target
  • step(dt)
    Parameters:
    {Number} dt
    delta time in seconds