Lag

Qualified name: algan.animation\_timeline.animation\_contexts.Lag

class Lag(ratio=0.5, runtime=None, **kwargs)[source]

Bases: AnimationContext

Overlap the block’s animations, each starting partway into the last.

Each animation begins after a fraction of the previous one has played, giving a cascade or ripple. Animating a list of Mobs inside Lag(0.1) is the usual way to make them arrive in a wave rather than together.

Parameters:
  • ratio (float) – Fraction of one animation’s runtime to wait before starting the next. 0 is fully simultaneous, 1 fully sequential, 0.1 starts each animation when the previous one is a tenth done. Can be larger than 1, in which case it introduces a pause (wait) after each animation finishes. Defaults to 0.5.

  • runtime (float | None) – Passed to AnimationContext .

  • **kwargs – Passed to AnimationContext .

Examples

with Lag(0.2):
    for square in squares:
        square.move(UP)

See also

Sync

Lag(0).

Seq

Lag(1).

Methods

Attributes

animation_manager

child_contexts

combine_easing

composed_easing

current_time

Where the authoring cursor sits within this context, in seconds.

easing

end_time

The furthest time anything recorded in this context reaches, in seconds.

equalize_runtimes

finished

kwargs

lag_ratio

new_animation

new_mobs

prev_context

priority_level

record_attr_modifications

record_funcs

runtime

runtime_per_part

spawn_at_end