Skip to main content

sequence

Macro sequence 

Source
macro_rules! sequence {
    ( $($items:tt)* ) => { ... };
}
Expand description

A Sequence of motions on one clock.

A bare motion lands after everything before it. To place one anywhere else, put the position in front of it:

sequence![
    fade_in,
    rel(-120) => slide_up,              // 120ms before the end so far
    with(0) => tint,                    // alongside the previous entry
    abs(600) => flash,                  // from the sequence's own start
    label("settled", 50) => ripple,     // 50ms after a placed label
]

The position goes first because a Rust macro cannot read anything but ,, ; or => after an expression — and => reads like a timeline anyway. Labels are placed with Sequence::label, so a sequence that uses them starts from the builder.