animator.anim.Anim

class animator.anim.Anim(duration: float, ease: Callable[[float], float] = <function get_pow_inout.<locals>.f>)

Bases: object

__init__(duration: float, ease: Callable[[float], float] = <function get_pow_inout.<locals>.f>) None
Parameters

duration – The duration of the animation in seconds. Negative values will keep the animation running

forever. If a negative value is used, the absolute value can be used as some sort of rate. :param ease_func: The easing function to use for the animation.

Methods

__init__(duration[, ease])

param duration

The duration of the animation in seconds. Negative values will keep the animation running

end()

Called once after the animation ends.

start()

Called once before the animation starts.

update(t)

Called every frame with the time since the animation started.

class State(value)

Bases: enum.Enum

The state of an animation.

FINISHED = 2

The animation has finished.

IDLE = 0

The animation has not started.

RUNNING = 1

The animation is running.

end() None

Called once after the animation ends. Do any cleanup here and make sure to set the final state.

start() None

Called once before the animation starts. Do any setup here.

update(t: float) None

Called every frame with the time since the animation started.

Parameters

t – Interpolated time since the animation started. This will be 0 at the start of the animation and 1 at

the end. Undefined behavior if the animation is infinite.