Skip to content

Tween

Easing

Animation Easing Functions.

BOUNCE_IN staticmethod

BOUNCE_IN(t: float) -> float

Bounce Easing In.

BOUNCE_OUT staticmethod

BOUNCE_OUT(t: float) -> float

Bounce Easing In.

BOUNCE_IN_OUT staticmethod

BOUNCE_IN_OUT(t: float) -> float

Bounce Easing In/Out.

CUBIC_IN staticmethod

CUBIC_IN(t: float) -> float

Cubic Easing In.

CUBIC_OUT staticmethod

CUBIC_OUT(t: float) -> float

Cubic Easing Out.

CUBIC_IN_OUT staticmethod

CUBIC_IN_OUT(t: float) -> float

Cubic Easing In/Out.

LINEAR staticmethod

LINEAR(t: float) -> float

Linear Easing.

QUAD_IN staticmethod

QUAD_IN(t: float) -> float

Quadratic Easing In.

QUAD_OUT staticmethod

QUAD_OUT(t: float) -> float

Quadratic Easing Out.

QUAD_IN_OUT staticmethod

QUAD_IN_OUT(t: float) -> float

Quadratic Easing In/Out.

QUARTIC_IN staticmethod

QUARTIC_IN(t: float) -> float

Quartic Easing In.

QUARTIC_OUT staticmethod

QUARTIC_OUT(t: float) -> float

Quartic Easing Out.

QUARTIC_IN_OUT staticmethod

QUARTIC_IN_OUT(t: float) -> float

Quartic Easing In/Out.

QUINTIC_IN staticmethod

QUINTIC_IN(t: float) -> float

Quintic Easing In.

QUINTIC_OUT staticmethod

QUINTIC_OUT(t: float) -> float

Quintic Easing Out.

QUINTIC_IN_OUT staticmethod

QUINTIC_IN_OUT(t: float) -> float

Quintic Easing In/Out.

SINE_IN staticmethod

SINE_IN(t: float) -> float

Sine Easing In.

SINE_OUT staticmethod

SINE_OUT(t: float) -> float

Sine Easing Out.

SINE_IN_OUT staticmethod

SINE_IN_OUT(t: float) -> float

Sine Easing In/Out.

Tween

Collection of tween utility methods.

calculate_progress staticmethod

calculate_progress(
    started_at: int,
    duration: float,
    easing: typing.Callable[[float], float],
) -> float

Calculate the progress of an ongoing tween, represented as a percentage.

PARAMETER DESCRIPTION
started_at

The starting tick provided by pygame.

TYPE: int

duration

The desired total time for the tween to take place in seconds.

TYPE: float

easing

The desired easing function/method to use - Usually an Easing child method.

TYPE: typing.Callable[[float], float]

RETURNS DESCRIPTION
float

The percentage progress of this tween.