Ordering
.play(duration) only times one action. To combine several, wrap them in one of these five combinators before calling .compile().
chain
Run fragments one after another.
[frag_a.play(s(1)), frag_b.play(s(1))].ord_chain()frag_b starts the moment frag_a finishes.
The second circle waits for the first.
all
Run fragments together. Finishes when the slowest one does.
chain([
[frag_a.play(s(1)), frag_b.play(cs(50))].ord_all(),
frag_c.play(cs(50)),
])The square waits for the slower circle before it starts.
The square starts once both circles have arrived.
any
Run fragments together. Finishes as soon as the fastest one does.
chain([
[frag_a.play(s(1)), frag_b.play(cs(50))].ord_any(),
frag_c.play(cs(50)),
])The square starts as soon as the faster circle arrives, compare that to all above.
The square starts the moment the faster circle arrives.
flow
Like chain, but each fragment starts a fixed delay after the previous one starts, not after it finishes.
circles.iter().map(|c| c.play(cs(60))).ord_flow(cs(15))A wave ripples through the row: each circle starts shortly after the last, not after it finishes.
delay
Push a single fragment’s start later.
use motiongfx::track::delay;
delay(cs(30), frag_a.play(s(1)))The circle sits still, then starts moving.
Next
Timeline: turn the result into something you can play.