summaryrefslogtreecommitdiff
path: root/anim/src/root.zig
diff options
context:
space:
mode:
Diffstat (limited to 'anim/src/root.zig')
-rw-r--r--anim/src/root.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/anim/src/root.zig b/anim/src/root.zig
index 7e4206a..60ae6dc 100644
--- a/anim/src/root.zig
+++ b/anim/src/root.zig
@@ -253,6 +253,13 @@ pub const Context = struct {
return add(s, Ties{ .cursor = c.cursor, .stage = c.stage, .quiet = c.quiet });
}
+ /// The ties, and a link the scene plays on a beat of its own (`Beat.play`):
+ /// register `name` framed as read, then linked to what it points at, held `hold`.
+ pub fn tiesWith(c: Context, s: *anim.Frame, name: []const u8, hold: f32) struct { anim.Obj, *const tying.Beat } {
+ const beat = s.new(tying.Beat{ .cursor = c.cursor, .name = name, .hold = hold, .t = s.value(-1) });
+ return .{ add(s, Ties{ .cursor = c.cursor, .stage = c.stage, .quiet = c.quiet, .beat = beat }), beat };
+ }
+
/// A scene's opening with a lens drawn from bytes (`nodes`, `array`):
/// as `establish`, and from half a second in the drawing's
/// `elements` come in, each rising 8 units, 2 f apart in address