summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-16 22:51:49 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit64a816dbe194c05e089729ac1fdc15061afdd903 (patch)
tree5b424f1eee653a5c607a41262a04bf843c262054 /examples
parent1cb36ee39a8bbc2cf61c28003670d760841d6d3e (diff)
downloadsketchbook-64a816dbe194c05e089729ac1fdc15061afdd903.tar.gz
sketchbook-64a816dbe194c05e089729ac1fdc15061afdd903.zip
anim: talks: gates that let time run on, pause, beside, loop, clear, slides and the Deck
A talk is a live scene re-run from the top every frame, a function of its time and of the gates opened so far. Frame.gate(open) waits while time runs on and records the value it opened with; pause() is the presenter's click. beside and loop are the sub-animations, slide() the second navigation level, clear() the end of a slide. anim.Deck is the playhead and the gate log as plain data for any sketch's State: update() takes an Ask (next, back, next_slide, back_slide, to, end) and runs the talk with the app mutable, shot() runs it read-only for drawing. A click during a step finishes it; back cuts to the picture held before the last click; an edit that moves the last opened gate moves t with it; exported, every gate holds Deck.hold. Live takes a namespace or a tuple of them (sources) and exposes frame. Builder.pause, Instant.clock and Frame.clock are gone: t runs through gates. A test-anim step runs the module's tests and the player's scenes.
Diffstat (limited to 'examples')
-rw-r--r--examples/vecanim/scenes/live.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/vecanim/scenes/live.zig b/examples/vecanim/scenes/live.zig
index cefdbc5..4af7998 100644
--- a/examples/vecanim/scenes/live.zig
+++ b/examples/vecanim/scenes/live.zig
@@ -61,7 +61,7 @@ fn frame(s: *anim.Frame) void {
for (dots) |d| {
const p = s.pose(d);
const envelope = 1 - s.get(damping) * (1 - @exp(-p.x * p.x / 1e5));
- p.y = s.get(height) * envelope * @sin(p.x / 90 - s.clock * 2);
+ p.y = s.get(height) * envelope * @sin(p.x / 90 - s.t * 2);
const near = @max(0, 1 - @abs(p.x - s.pointer[0]) / 120);
p.scale = 1 + near;
p.y -= 40 * near;