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

ActionTween. More...

Inherits ActionInterval.

Public Member Functions

ActionTweenreverse () const override
 override Action.
 
ActionTweenclone () const override
 override Action.
 
- Public Member Functions inherited from ActionInterval
float getElapsed (void)
 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.
 

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

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...
 
- Protected Member Functions inherited from ActionInterval
bool initWithDuration (float 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.

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.


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