Cocos2d-x  v3.12
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
ActionInterval Class Reference

An interval action is an action that takes place within a certain period of time. More...

Inherits FiniteTimeAction.

Inherited by AccelAmplitude, AccelDeccelAmplitude, ActionCamera, ActionEase, ActionFloat, ActionTween, Animate, Animate3D, BezierBy, Blink, CardinalSplineTo, DeccelAmplitude, DelayTime, FadeTo, GridAction, JumpBy, MoveBy, ProgressFromTo, ProgressTo, Repeat, RepeatForever, ReverseTime, RotateBy, RotateTo, ScaleTo, Sequence, SkewTo, Spawn, TargetedAction, TintBy, and TintTo.

Public Member Functions

float getElapsed (void)
 How many seconds had elapsed since the actions started to run. More...
 
var getElapsed ()
 How many seconds had elapsed since the actions started to run. More...
 
local getElapsed ()
 How many seconds had elapsed since the actions started to run. More...
 
void setAmplitudeRate (float amp)
 Sets the amplitude rate, extension in GridAction. More...
 
float getAmplitudeRate (void)
 Gets the ampliture rate, extension in GridAction. More...
 
virtual bool isDone (void) const override
 override Action.
 
local isDone ()
 override Action.
 
virtual ActionIntervalreverse () const override
 override Action.
 
virtual ActionIntervalclone () const override
 override Action.
 
var clone ()
 override Action.
 
local clone ()
 override Action.
 

Protected Member Functions

bool initWithDuration (float d)
 initializes the action with the duration. More...
 
var initWithDuration ( var d)
 initializes the action with the duration. More...
 
local initWithDuration ( local d)
 initializes the action with the duration. More...
 

Detailed Description

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 ActionInterval 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.

Example:

Member Function Documentation

float getElapsed ( void  )
inline

How many seconds had elapsed since the actions started to run.

The seconds had elapsed since the ations started to run.

var getElapsed (   )
inline

How many seconds had elapsed since the actions started to run.

The seconds had elapsed since the ations started to run.

local getElapsed (   )
inline

How many seconds had elapsed since the actions started to run.

The seconds had elapsed since the ations started to run.

void setAmplitudeRate ( float  amp)

Sets the amplitude rate, extension in GridAction.

The ampliture rate.

var setAmplitudeRate ( var  amp)

Sets the amplitude rate, extension in GridAction.

The ampliture rate.

local setAmplitudeRate ( local  amp)

Sets the amplitude rate, extension in GridAction.

The ampliture rate.

float getAmplitudeRate ( void  )

Gets the ampliture rate, extension in GridAction.

The ampliture rate.

var getAmplitudeRate (   )

Gets the ampliture rate, extension in GridAction.

The ampliture rate.

local getAmplitudeRate (   )

Gets the ampliture rate, extension in GridAction.

The ampliture rate.

bool initWithDuration ( float  d)
protected

initializes the action with the duration.

The duration Return true if initialized successfully, otherwise return false.

var initWithDuration ( var  d)
protected

initializes the action with the duration.

The duration Return true if initialized successfully, otherwise return false.

local initWithDuration ( local  d)
protected

initializes the action with the duration.

The duration Return true if initialized successfully, otherwise return false.


The documentation for this class was generated from the following file: