summaryrefslogtreecommitdiff
path: root/src/anim
Commit message (Collapse)AuthorAge
* anim: part, the shapes of an object inside a rectangle as an object of their ownGabriel Schneider2 days
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Typst runs with / as its root, so a source can name any fileGabriel Schneider2 days
| | | | | | | | | | | | | | | | | | | | | The Typst step ran in .zig-cache/typst with Typst's default root, the directory of the file it compiles, so a source could name no file but one in the cache: #image("/home/me/manual.pdf", page: 31) failed with "would escape the project root". It now runs with --root /, which makes an absolute path in a source the file's own path; relative paths still resolve in the cache, as before. Why / and not the build root: the file a scene names (a manual, a paper) lives where its owner keeps it, outside any project, and a copy or link under the project is one jj add away from being committed. / is safe in that Typst only reads what a source names, and a scene's sources are its author's code, compiled by a build that can already read and run anything. The cache is still keyed by preamble and source alone: a file changed in place keeps its old SVG until its cache entry goes (typst.zig says so). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
* anim: Event.key, and the talk example runs in a windowGabriel Schneider2 days
| | | | | | An Event says its key (abi.Event.key), which the player and the talk example each spelled out by hand; `zig build talk` shows examples/talk.zig in a window on the generic host, its state under .zig-cache, and `zig build talk-lib --watch` beside it reloads every edit in place. Co-Authored-By: Claude Fable 5.2 <[email protected]>
* anim: the stock player runs on the DeckGabriel Schneider2 days
| | | | | | | | | | | | The player's State is an anim.Deck plus the viewer's settings; keys and clicks become an Ask: click, space and page down step (space plays or pauses a scene with no pause), page up and backspace go back a step, ] and [ go a slide, P plays or pauses, left/right/home/end/,/. seek through Ask.to and Ask.end. A compiled scene is a talk without gates. The HUD shows the slide and step, and when the talk waits. Exported, each pause holds the scene file's hold (1 s). Its frozen hold (held, stopBetween, proceed) is gone. Scripts read deck.t and deck.playing where they read t and playing.
* anim: the player's render path moves into anim.PainterGabriel Schneider2 days
| | | | | | | | | | 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 Schneider2 days
| | | | | | | | | | | | | | | | | | | 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: a scene file says its page colour (background)Gabriel Schneider7 days
|
* sketchbook: text in six faces of the Go family, all bundled (f.textIn, ↵Gabriel Schneider7 days
| | | | host.textSizeIn, sk.Face)
* sketchbook: anim, manim-style scenes as a module (from the game's vecanim), ↵Gabriel Schneider7 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]>