summaryrefslogtreecommitdiff
path: root/src/anim/root.zig
Commit message (Collapse)AuthorAge
* anim: part, the shapes of an object inside a rectangle as an object of their ownGabriel Schneider29 hours
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | s.part(of, .{ .x, .y, .w, .h }) takes the shapes of an object whose bounds' centre lies in the rectangle (x, y its centre, in the object's units: the same literal s.rect would lay over it standing at the origin at scale 1) and makes them an object, around the rectangle's centre, so indicate, scaleTo and rotate turn it about itself. The object draws the rest from then on (its new cut), so a part can be written in, moved away or morphed while the page around it stays. A part stands where its shapes stood and shows as the object does after the plays laid so far: taken from a page that has faded in, it is there; taken first, it fades in with nothing until played. A shape goes to the first part that takes it; parts of parts work the same way. transformInto morphs into the whole of its target, as if nothing were cut from it, so a morph's result can be split into parts taken after it (which then stand where they were and show as it does). How: Source.part holds the object as it was (a pointer: in a compiled scene to a comptime constant, in a live one into the frame's arena) and the area; Object.cut lists the areas taken from it; both are in the object's id. anim.sift makes either drawing out of the whole one, sharing its geometry; the Painter sifts its cached whole, so a page is parsed once however many parts it gives. In a compiled scene the part follows its object through the plays laid before it was taken (keys copied, moved by the area's centre at the object's scale and rotation); in a live one it starts from the object's shown and settled poses. build now also moves a shape's clip with its centring (it moved the shape and left the clip behind). Test, at the end of root.zig: a row of three squares, the right one taken once the row has faded in, then each moved: the compiled and the live scene agree at every instant, the part fades with the row, stands where its square stood, and the row keeps the other two. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* anim: the player's render path moves into anim.PainterGabriel Schneider29 hours
| | | | | | | | | | render, paint, reveal, built, stage, guides and labels move verbatim from player.zig into src/anim/Painter.zig, with the viewer's settings and the Typst module as parameters, so a sketch that runs a Deck itself paints its shot the same way: a Painter in its Session and paint() once a frame. The scene's frame size is anim.width/height and a Shot carries its t. Pixels unchanged: the scene tests' screenshots and all 92 exported frames match the previous build's.
* anim: talks: gates that let time run on, pause, beside, loop, clear, slides ↵Gabriel Schneider29 hours
| | | | | | | | | | | | | | | | | | | and the Deck A talk is a live scene re-run from the top every frame, a function of its time and of the gates opened so far. Frame.gate(open) waits while time runs on and records the value it opened with; pause() is the presenter's click. beside and loop are the sub-animations, slide() the second navigation level, clear() the end of a slide. anim.Deck is the playhead and the gate log as plain data for any sketch's State: update() takes an Ask (next, back, next_slide, back_slide, to, end) and runs the talk with the app mutable, shot() runs it read-only for drawing. A click during a step finishes it; back cuts to the picture held before the last click; an edit that moves the last opened gate moves t with it; exported, every gate holds Deck.hold. Live takes a namespace or a tuple of them (sources) and exposes frame. Builder.pause, Instant.clock and Frame.clock are gone: t runs through gates. A test-anim step runs the module's tests and the player's scenes.
* sketchbook: text in six faces of the Go family, all bundled (f.textIn, ↵Gabriel Schneider6 days
| | | | host.textSizeIn, sk.Face)
* sketchbook: anim, manim-style scenes as a module (from the game's vecanim), ↵Gabriel Schneider6 days
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]>