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

ActionTween. More...

Inherits ActionInterval.

Public Member Functions

ActionTweenreverse () const override
 override Action.
 
var reverse ()
 override Action.
 
local reverse ()
 override Action.
 
ActionTweenclone () const override
 override Action.
 
local clone ()
 override Action.
 
- Public Member Functions inherited from ActionInterval
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.
 

Static Public Member Functions

static ActionTweencreate (float duration, const std::string &key, float from, float to)
 Create and initializes the action with the property name (key), and the from and to parameters. More...
 
var create ( var duration, var key, var from, var to)
 Create and initializes the action with the property name (key), and the from and to parameters. More...
 
local create ( local duration, local key, local from, local to)
 Create and initializes the action with the property name (key), and the from and to parameters. More...
 

Protected Member Functions

bool initWithDuration (float duration, const std::string &key, float from, float to)
 Initializes the action with the property name (key), and the from and to parameters. More...
 
var initWithDuration ( var duration, var key, var from, var to)
 Initializes the action with the property name (key), and the from and to parameters. More...
 
local initWithDuration ( local duration, local key, local from, local to)
 Initializes the action with the property name (key), and the from and to parameters. More...
 
- Protected Member Functions inherited from ActionInterval
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

ActionTween.

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:

Another example: ScaleTo action could be rewritten using PropertyAction:

Member Function Documentation

static ActionTween* create ( float  duration,
const std::string &  key,
float  from,
float  to 
)
static

Create and initializes the action with the property name (key), and the from and to parameters.

The duration of the ActionTween. It's a value in seconds. The key of property which should be updated. The value of the specified property when the action begin. The value of the specified property when the action end. If the creation success, return a pointer of ActionTween; otherwise, return nil.

var create ( var  duration,
var  key,
var  from,
var  to 
)
static

Create and initializes the action with the property name (key), and the from and to parameters.

The duration of the ActionTween. It's a value in seconds. The key of property which should be updated. The value of the specified property when the action begin. The value of the specified property when the action end. If the creation success, return a pointer of ActionTween; otherwise, return nil.

local create ( local  duration,
local  key,
local  from,
local  to 
)
static

Create and initializes the action with the property name (key), and the from and to parameters.

The duration of the ActionTween. It's a value in seconds. The key of property which should be updated. The value of the specified property when the action begin. The value of the specified property when the action end. If the creation success, return a pointer of ActionTween; otherwise, return nil.

bool initWithDuration ( float  duration,
const std::string &  key,
float  from,
float  to 
)
protected

Initializes the action with the property name (key), and the from and to parameters.

The duration of the ActionTween. It's a value in seconds. The key of property which should be updated. The value of the specified property when the action begin. The value of the specified property when the action end. If the initialization success, return true; otherwise, return false.

var initWithDuration ( var  duration,
var  key,
var  from,
var  to 
)
protected

Initializes the action with the property name (key), and the from and to parameters.

The duration of the ActionTween. It's a value in seconds. The key of property which should be updated. The value of the specified property when the action begin. The value of the specified property when the action end. If the initialization success, return true; otherwise, return false.

local initWithDuration ( local  duration,
local  key,
local  from,
local  to 
)
protected

Initializes the action with the property name (key), and the from and to parameters.

The duration of the ActionTween. It's a value in seconds. The key of property which should be updated. The value of the specified property when the action begin. The value of the specified property when the action end. If the initialization success, return true; otherwise, return false.


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