diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-10 12:10:40 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-12 13:22:02 -0300 |
| commit | f8d3a32f4f995eeb7e162b0702998b0565c11e4e (patch) | |
| tree | 66ac9e007f9bedb3ce86a3f56a7bc9773c89b96e /README.md | |
| parent | c84019e2f561a128ecdb8d50b39d510cae65d6e7 (diff) | |
| download | sketchbook-f8d3a32f4f995eeb7e162b0702998b0565c11e4e.tar.gz sketchbook-f8d3a32f4f995eeb7e162b0702998b0565c11e4e.zip | |
sketchbook: a scene file says its page colour (background)
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -110,6 +110,14 @@ in; `SKETCHBOOK_FONT="JetBrains Mono"` in the environment puts an installed family before it. On the web it is the page's `monospace`, 8 px a character. +`f.textIn(face, x, y, scale, bytes, color)` is the same line in another +face of the Go family, all six bundled in the binary (`sk.Face`): `.mono`, +`.mono_bold`, `.mono_italic` for data and code, `.sans`, `.sans_medium`, +`.sans_bold` for what is said about it; `f.host.textSizeIn(face, scale, +bytes)` measures it. The three mono faces advance alike (0.6 em: whole +pixels at 25, 30, 35, 45 and 60 px and at their doubles), so columns of +text need no measuring. The web host draws every face as its one. + `f.openFile("open", .{ .pattern = "wav;flac" })` shows the system's file dialog; the answer comes back as the console line `open <path>`, so it reaches the sketch's `command` like anything typed there. `f.run(line)` @@ -170,8 +178,10 @@ A `Pen` is plain data (`fill: ?Color`, `stroke: ?Color`, `width`, `join`, `cap`, `xf: Affine`), so it can be a `const`, a State field, or a copy changed for one call. A null fill is `noFill()`, a null stroke `noStroke()`. `circle`, `line`, `polyline` (Processing's `beginShape()` / -`endShape()`, open), `polygon` (`endShape(CLOSE)`), `rect` and `point` (a -dot `width` across, Processing's `point`) tessellate into `f.scratch` and +`endShape()`, open), `polygon` (`endShape(CLOSE)`), `rect`, `point` (a +dot `width` across, Processing's `point`) and `dashed` (a polyline in +dashes, `.{ on, off }` along the path, each dash whole round a corner; +`Tessellation.strokeDashes` underneath) tessellate into `f.scratch` and emit a shape for the fill and one for the stroke; out of memory, they log and drop it, as `emit` does. Joins are `.miter` (bevelled past 4 half-widths), `.round` or `.bevel`, caps `.butt`, `.round` or `.square`; @@ -429,7 +439,9 @@ returns a handle. Animations are methods of the handle: `write`, `create`, options are `.seconds`, `.ease` (any `fn (f32) f32`) and `.lag` (manim's lag ratio). `wait` moves time on, `pause()` holds the player there until a click, like a slide. Positions are scene units: 1280x720 of them show at -camera zoom 1, the origin in the middle, y down. +camera zoom 1, the origin in the middle, y down. The page behind them is +the scene file's `pub const background = 0xRRGGBB` (manim's grey without +one). A scene is one of two kinds, which share every call: |
