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


NameDescriptionType
start_posThe starting position of the animation.Vec2
end_posThe ending position of the animation.Vec2
is_doneCheck whether the animation has finished.bool

Methods


Step

step() Vec2

Advance the animation and get its current position.

Returns

Vec2 : Interpolated position.

Pause

pause() None

Pause the animation's progression.

Resume

resume() None

Resume the animation from its current state.

Restart

restart() None

Restart the animation from the beginning.

Reverse

reverse() None

Reverse the direction of the animation.