diff options
Diffstat (limited to 'anim/src/stage.zig')
| -rw-r--r-- | anim/src/stage.zig | 18 |
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. |
