Lag¶
Qualified name: algan.animation\_timeline.animation\_contexts.Lag
- class Lag(ratio=0.5, runtime=None, **kwargs)[source]¶
Bases:
AnimationContextOverlap 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.
0is fully simultaneous,1fully sequential,0.1starts 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 to0.5.runtime (float | None) – Passed to
AnimationContext.**kwargs – Passed to
AnimationContext.
Examples
with Lag(0.2): for square in squares: square.move(UP)
Methods
Attributes
animation_managerchild_contextscombine_easingcomposed_easingcurrent_timeWhere the authoring cursor sits within this context, in seconds.
easingend_timeThe furthest time anything recorded in this context reaches, in seconds.
equalize_runtimesfinishedkwargslag_rationew_animationnew_mobsprev_contextpriority_levelrecord_attr_modificationsrecord_funcsruntimeruntime_per_partspawn_at_end