⚠️ This documentation corresponds to the latest development branch of axmol. It might diverge from the official releases.
|
Axmol Engine 3.0.0-84160d4
|
#include <ActionTween.h>
Inherits ActionInterval.
Public Member Functions | |
| bool | initWithDuration (float duration, std::string_view key, float from, float to) |
| Initializes the action with the property name (key), and the from and to parameters. | |
| Public Member Functions inherited from ActionInterval | |
| float | getElapsed () |
| How many seconds had elapsed since the actions started to run. | |
| void | setAmplitudeRate (float amp) |
| Sets the amplitude rate, extension in GridAction. | |
| float | getAmplitudeRate () |
| Gets the amplitude rate, extension in GridAction. | |
| void | step (float dt) override |
| bool | initWithDuration (float d) |
| initializes the action | |
Static Public Member Functions | |
| static ActionTween * | create (float duration, std::string_view key, float from, float to) |
| Create and initializes the action with the property name (key), and the from and to parameters. | |
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:
|
static |
Create and initializes the action with the property name (key), and the from and to parameters.
| duration | The duration of the ActionTween. It's a value in seconds. |
| key | The key of property which should be updated. |
| from | The value of the specified property when the action begin. |
| to | The value of the specified property when the action end. |
| bool initWithDuration | ( | float | duration, |
| std::string_view | key, | ||
| float | from, | ||
| float | to ) |
Initializes the action with the property name (key), and the from and to parameters.
| duration | The duration of the ActionTween. It's a value in seconds. |
| key | The key of property which should be updated. |
| from | The value of the specified property when the action begin. |
| to | The value of the specified property when the action end. |