Tween
A class for animating values over time using easing functions.
Constructor
-
Tween(
ease_func: Callable[[float], float],
duration: float
) → Tween
A class for animating values over time using easing functions.
Properties
| Name | Description | Type |
|---|---|---|
start_pos | The starting position of the animation. | Vec2 |
end_pos | The ending position of the animation. | Vec2 |
is_done | Check whether the animation has finished. | bool |
Methods
Step
step() → Vec2Advance the animation and get its current position.
Returns
Vec2 : Interpolated position.
Pause
pause() → NonePause the animation's progression.
Resume
resume() → NoneResume the animation from its current state.
Restart
restart() → NoneRestart the animation from the beginning.
Reverse
reverse() → NoneReverse the direction of the animation.