timeline — Luau Binding
require("timeline"): build a schedule of the other systems' sequences — parallel and sequential — and play, seek, or loop it on the stage tick. The programmatic surface of the timeline system. Every function is[antos].
Status: design. Not built yet.
local timeline = require("timeline")
Build
A builder — each call returns the timeline, so steps chain. Actions are the siblings' start calls (motion.play(...), tween.to(...)), captured, not run, until the timeline plays.
| Call | Does |
|---|---|
tl:add(action) |
the first (or parallel-to-start) step |
tl:then_(action) |
run after the previous step finishes (sequential) |
tl:with(action) |
run alongside the previous step (parallel) |
tl:wait(d) |
a gap of d (stage ticks) |
tl:call(fn) |
run fn at this point — fire an event, set a flag |
tl:at(t, action) |
schedule action at an absolute time t |
Play
| Call | Returns | Does |
|---|---|---|
timeline.new() |
tl |
a new, empty timeline |
tl:play(opts?) |
handle |
start it — opts = { loop = false, speed = 1.0 } |
tl:seek(t) |
— | set the timeline to its exact state at time t — scrub / preview / test, no hidden state |
tl:pause() / tl:resume() / tl:stop() |
ok |
transport control |
tl:running() |
bool |
still playing |
local timeline = require("timeline")
local motion, tween, stage = require("motion"), require("tween"), require("stage")
local intro = timeline.new()
:add( motion.play(logo, slide_in$) )
:with( tween.to(logo, { alpha = 1 }, { duration = 0.6 }) )
:wait(1.0)
:call(function() stage.emit("intro:done") end)
intro:play()
-- intro:seek(0.8) -- or jump straight to 0.8s in, exactly