summaryrefslogtreecommitdiff
path: root/src/anim/player.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-10 12:10:40 -0300
committerGabriel Schneider <[email protected]>2026-11-12 13:22:02 -0300
commitf8d3a32f4f995eeb7e162b0702998b0565c11e4e (patch)
tree66ac9e007f9bedb3ce86a3f56a7bc9773c89b96e /src/anim/player.zig
parentc84019e2f561a128ecdb8d50b39d510cae65d6e7 (diff)
downloadsketchbook-f8d3a32f4f995eeb7e162b0702998b0565c11e4e.tar.gz
sketchbook-f8d3a32f4f995eeb7e162b0702998b0565c11e4e.zip
sketchbook: a scene file says its page colour (background)
Diffstat (limited to 'src/anim/player.zig')
-rw-r--r--src/anim/player.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/anim/player.zig b/src/anim/player.zig
index bac5178..090b6cb 100644
--- a/src/anim/player.zig
+++ b/src/anim/player.zig
@@ -26,6 +26,8 @@ const typst = @import("typst");
const geom = vector.geom;
pub const name = if (@hasDecl(scene_file, "name")) scene_file.name else "anim";
+/// The page: the scene file's `background` (0xRRGGBB), or manim's.
+const background: u32 = if (@hasDecl(scene_file, "background")) scene_file.background else anim.background;
/// The scene's frame, in scene units: what shows at camera zoom 1.
pub const width = 1280;
pub const height = 720;
@@ -234,7 +236,7 @@ fn paint(s: *const State, ss: *Session, layers: anytype, f: *sk.Frame, shot: ani
const world = stage(s, shot.camera, canvas);
var used: usize = 0;
// The first layer is the background too.
- var open: ?*@TypeOf(layers.items[0]) = try begun(layers, &used, f, canvas, anim.color(anim.background));
+ var open: ?*@TypeOf(layers.items[0]) = try begun(layers, &used, f, canvas, anim.color(background));
var shapes: usize = 0;
for (shot.objects, shot.poses, 0..) |o, pose, i| {
if (!pose.visible or pose.opacity <= 0) continue;