TimedAction¶
Inherits: Action
C++ type: TimedAction
Description¶
Base class for all fixed-duration tweens. TimedAction drives a single value from 0.0 to 1.0 over a specified number of seconds, optionally with an easing curve. Concrete subclasses (AlphaAction, ColorAction, PositionAction, RotationAction, ScaleAction) apply that interpolated value to a specific property of the target object.
You typically do not instantiate TimedAction directly.
Properties¶
| Type | Name | Default | Langs |
|---|---|---|---|
| float | duration | 1.0 |
C++ | Lua |
| bool | loop | false |
C++ | Lua |
Methods¶
| Type | Name | Langs |
|---|---|---|
| void | setFunctionType | C++ | Lua |
| float | getValue | C++ | Lua |
| float | getTime | C++ | Lua |
| void | setDuration | C++ | Lua |
| float | getDuration | C++ | Lua |
| void | setLoop | C++ | Lua |
| bool | isLoop | C++ | Lua |
Enumerations¶
EaseType¶
Controls the interpolation curve applied to the tween.
- LINEAR — Constant speed from start to end.
- QUAD_IN / QUAD_OUT / QUAD_IN_OUT — Quadratic easing (gentle acceleration or deceleration).
- CUBIC_IN / CUBIC_OUT / CUBIC_IN_OUT — Cubic easing (stronger acceleration or deceleration).
- QUART_IN / QUART_OUT / QUART_IN_OUT — Quartic easing.
- QUINT_IN / QUINT_OUT / QUINT_IN_OUT — Quintic easing.
- SINE_IN / SINE_OUT / SINE_IN_OUT — Sinusoidal easing (smooth, natural motion).
- EXPO_IN / EXPO_OUT / EXPO_IN_OUT — Exponential easing (very sharp).
- CIRC_IN / CIRC_OUT / CIRC_IN_OUT — Circular easing.
- ELASTIC_IN / ELASTIC_OUT / ELASTIC_IN_OUT — Elastic spring overshoot.
- BACK_IN / BACK_OUT / BACK_IN_OUT — Slight overshoot (anticipation).
- BOUNCE_IN / BOUNCE_OUT / BOUNCE_IN_OUT — Bouncing ball effect.
- CUSTOM — Provide your own ease function via the
Easeoverloads.
Property details¶
duration¶
- Setter: void setDuration(float duration)
- Getter: float getDuration() const
Length of the tween in seconds.
loop¶
- Setter: void setLoop(bool loop)
- Getter: bool isLoop() const
When true, the tween restarts from the beginning after completing.
Method details¶
setFunctionType¶
- void setFunctionType(EaseType functionType)
Apply an easing curve to the tween. See EaseType for available values.
getValue / getTime¶
- float getValue() const
- float getTime() const
getValue() returns the current eased output value in [0, 1]. getTime() returns the current elapsed time in seconds.