summaryrefslogtreecommitdiff
path: root/examples/vecanim
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-16 22:59:59 -0300
committerGabriel Schneider <[email protected]>2026-11-17 12:15:01 -0300
commit6b07c3b2ee86592a28a713b4c6c40007c28eb6b8 (patch)
treecc95801ec3fd34e90315bf033db3a714a68dc8c0 /examples/vecanim
parent7e3475a779f9e8dcb14b96cfc59e2b92a20c0cda (diff)
downloadsketchbook-6b07c3b2ee86592a28a713b4c6c40007c28eb6b8.tar.gz
sketchbook-6b07c3b2ee86592a28a713b4c6c40007c28eb6b8.zip
examples: a talk that runs its own Deck, and its script
examples/talk.zig keeps an anim.Deck in its State beside its own data, turns clicks and keys into asks and paints with an anim.Painter: two slides, a mass that bobs (loop) while the deck waits, a damping slider laid out and hit-tested in the talk (it takes its clicks), a choice gate that branches on it, and slide 1 cleared beside slide 2's writing. test/talk.script (zig build test-talk) steps it, finishes a step on a click, goes back, jumps slides, drags the slider without advancing, reloads mid-wait with the first step retimed (same step, t a second later) and checks two exports with 2 s holds frame by frame. The vecanim live scene's words follow the new pause.
Diffstat (limited to 'examples/vecanim')
-rw-r--r--examples/vecanim/scenes/live.zig7
-rw-r--r--examples/vecanim/test/live.script5
2 files changed, 7 insertions, 5 deletions
diff --git a/examples/vecanim/scenes/live.zig b/examples/vecanim/scenes/live.zig
index 4af7998..9b94d17 100644
--- a/examples/vecanim/scenes/live.zig
+++ b/examples/vecanim/scenes/live.zig
@@ -1,6 +1,7 @@
//! A live scene, presented like slides: `frame` runs every frame, so the
-//! code after the plays can follow the mouse, the clock or any data, and
-//! `pause` holds until a click. Everything it needs is in this file.
+//! code after the plays can follow the mouse, the time or any data, and
+//! what comes after a `pause` waits for a click while time runs on.
+//! Everything it needs is in this file.
const anim = @import("anim");
pub const typst_preamble =
@@ -28,7 +29,7 @@ fn frame(s: *anim.Frame) void {
s.play(.{ title.fadeOut(), hint.fadeOut() }, .{ .seconds = 0.6 });
// A wave of dots: its height is a value the timeline animates, its
- // phase the wall clock, which runs on through pauses.
+ // phase the scene's time, which runs on while a pause waits.
const wave = s.typst(typst.wave, .{ .y = -220, .scale = 1.2 });
const note = s.typst(typst.note, .{ .y = 230 });
const height = s.value(0);
diff --git a/examples/vecanim/test/live.script b/examples/vecanim/test/live.script
index a3ddcdc..d955b6f 100644
--- a/examples/vecanim/test/live.script
+++ b/examples/vecanim/test/live.script
@@ -1,5 +1,6 @@
-# Plays the live scene headless: it holds at each pause until a click, the
-# dots follow the pointer, and the guides draw over everything.
+# Plays the live scene headless: it waits at each pause for a click, the
+# wave running on, the dots follow the pointer, and the guides draw over
+# everything.
frames 150
expect t 2
screenshot .zig-cache/e2e/live-title.png