summaryrefslogtreecommitdiff
path: root/anim/src/stage.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-11 20:08:07 -0300
committerGabriel Schneider <[email protected]>2026-11-11 21:45:12 -0300
commit15de88cf82c187635c1989e91bfa639a10304066 (patch)
tree16fa83854258c0c6aec1dff7f70ebabf5fd64c09 /anim/src/stage.zig
parent0ec2376cae2fdfc50e90d930ebc86c7a5b7f5594 (diff)
downloadcomputeranim-15de88cf82c187635c1989e91bfa639a10304066.tar.gz
computeranim-15de88cf82c187635c1989e91bfa639a10304066.zip
canim: a column of text as an experiment; the disassembly tied to the stack
From the user. A scene may set its text in a column beside the panes a beat is about: col.beat names the panes and their rows, where the text is placed (beside, below, above, or on a drawing) and what it is level with; panes the beat leaves out fold to their title bars on a shelf, their changes struck there. Tried as two scenes beside the originals: the call followed down (column) and a bubble on sort's rings (column_sort). annotation = .tied names the word an instruction touched and draws a touch to its stack row; offsets count from the frame's base; rsp's pin travels with its amount before the stack follows; .whole keeps the full chain. carry = .arrow draws a value's way between memory and a register. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa
Diffstat (limited to 'anim/src/stage.zig')
-rw-r--r--anim/src/stage.zig18
1 files changed, 16 insertions, 2 deletions
diff --git a/anim/src/stage.zig b/anim/src/stage.zig
index a03c8bd..bbf5887 100644
--- a/anim/src/stage.zig
+++ b/anim/src/stage.zig
@@ -14,7 +14,7 @@ pub const Part = enum { band, view, source, disasm, registers, stack, backtrace,
pub const Stage = struct {
first: Split,
- moves: [8]Move = undefined,
+ moves: [32]Move = undefined,
count: usize = 0,
/// Seconds into the band's lens rising from its bytes (`Context.establish`,
/// `ties.rise`); far past it, for a scene that does not raise one.
@@ -31,12 +31,26 @@ pub const Stage = struct {
hold_in: anim.Value,
/// The registers panel's rows (the scene's, `layout.fit`): every split it changes to keeps them. 0: as the split has it.
registers_rows: f32 = 0,
+ /// 0 the working frame, 1 the column (`column.zig`): the clock under the text column.
+ column: anim.Value,
+ /// How much larger the band's drawing is drawn than its lens's size (a
+ /// column's `on`, `above`: the drawing across both columns), its tag not.
+ zoom: anim.Value,
const Move = struct { from: Split, to: Split, p: anim.Value };
/// A stage at `split`, made where a scene's components can keep a pointer to it.
pub fn init(s: *anim.Frame, split: Split) *Stage {
- return s.new(Stage{ .first = split, .rise = s.value(std.math.floatMax(f32)), .drawing = s.value(1), .view = s.value(1), .hold = s.value(-1), .hold_free = s.value(0), .hold_in = s.value(0) });
+ return s.new(Stage{ .first = split, .rise = s.value(std.math.floatMax(f32)), .drawing = s.value(1), .view = s.value(1), .hold = s.value(-1), .hold_free = s.value(0), .hold_in = s.value(0), .column = s.value(0), .zoom = s.value(1) });
+ }
+
+ /// Every panel to its box in `to`, as it is (no fit), over `seconds` on
+ /// `glide`, the drawing not faded: the column's moves (`column.zig`).
+ pub fn glide(st: *Stage, s: *anim.Frame, to: Split, seconds: f32) void {
+ const p = s.value(0);
+ st.moves[st.count] = .{ .from = st.last(), .to = to, .p = p };
+ st.count += 1;
+ s.play(.{p.to(1)}, .{ .seconds = seconds, .ease = anim.ease.linear });
}
/// The split the stage ends in, after every move so far.