summaryrefslogtreecommitdiff
path: root/test/scene_live.script
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-10 11:27:39 -0300
committerGabriel Schneider <[email protected]>2026-11-12 13:22:02 -0300
commit71e534631bf68f33f802d64794340870374b9f69 (patch)
tree2a45229ce238a4e2ce355683f0e75a7725d4851a /test/scene_live.script
parent00605f7a109845a99f16621b267305a8b995dddc (diff)
downloadsketchbook-71e534631bf68f33f802d64794340870374b9f69.tar.gz
sketchbook-71e534631bf68f33f802d64794340870374b9f69.zip
sketchbook: anim, manim-style scenes as a module (from the game's vecanim), with objects a scene draws itself
The player takes its canvas from the room it has and fits the scene's frame into it, plays through and quits when exported, and draws vector objects in runs around custom ones. The renderers' resvg comparison and the timings come along as `zig build diff` and `zig build bench`; the comparison's reference is padded to whole blocks rather than squeezed, which had put Typst text over the limit. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Diffstat (limited to 'test/scene_live.script')
-rw-r--r--test/scene_live.script37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/scene_live.script b/test/scene_live.script
new file mode 100644
index 0000000..30b2087
--- /dev/null
+++ b/test/scene_live.script
@@ -0,0 +1,37 @@
+# The live test scene, through the player. It holds at the pause.
+frames 150
+expect t 2
+screenshot .zig-cache/anim/live.png
+# The custom panel is over the circle added before it,
+expect-pixel .zig-cache/anim/live.png 600 330 32 64 96 255 1
+expect-pixel .zig-cache/anim/live.png 450 360 252 98 85 255 1
+# under the square added after it,
+expect-pixel .zig-cache/anim/live.png 725 400 131 193 103 255 1
+# and its bar is as full as the value the timeline moved to 0.5.
+expect-pixel .zig-cache/anim/live.png 600 390 240 172 95 255 1
+expect-pixel .zig-cache/anim/live.png 680 390 32 64 96 255 1
+# Half way through its move it is half way.
+console set playing false
+console set t 1.5
+screenshot .zig-cache/anim/live-moving.png
+expect-pixel .zig-cache/anim/live-moving.png 400 330 32 64 96 255 1
+expect-pixel .zig-cache/anim/live-moving.png 600 330 252 98 85 255 1
+# The CPU renderer layers the same way.
+console set t 2
+key b
+expect backend cpu
+screenshot .zig-cache/anim/live-cpu.png
+expect-pixel .zig-cache/anim/live-cpu.png 600 330 32 64 96 255 1
+expect-pixel .zig-cache/anim/live-cpu.png 725 400 131 193 103 255 1
+key b
+# A click continues: the camera zooms to 2 and the panel fades to half,
+# over the background where it now reaches.
+click 640 360
+expect playing true
+frames 70
+screenshot .zig-cache/anim/live-zoom.png
+expect-pixel .zig-cache/anim/live-zoom.png 800 300 30 46 64 255 2
+# Guides draw over everything.
+key g
+expect guides true
+screenshot .zig-cache/anim/live-guides.png