@algorisys/tinyfly 0.95.0 → 0.97.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: tinyfly
3
- description: Write animations with tinyfly (@algorisys/tinyfly), the JSON-first animation engine — timelines and tracks, canvas shapes, stick-figure characters acting from beat scripts, code panels figures act on, teaching figures and headless video. Use when asked to create, edit or fix a tinyfly animation, a stick-figure scene, an animated code walkthrough or a tinyfly timeline.
3
+ description: Write animations with tinyfly (@algorisys/tinyfly), the JSON-first animation engine — timelines and tracks, canvas shapes, stick-figure characters acting from beat scripts, surfaces figures act on (code panels, whiteboards, charts, props), teaching figures and headless video. Use when asked to create, edit or fix a tinyfly animation, a stick-figure scene, an animated code walkthrough, a whiteboard lesson, a chart presentation or a tinyfly timeline.
4
4
  ---
5
5
 
6
6
  # Writing tinyfly animations
@@ -15,13 +15,14 @@ Run `npx @algorisys/tinyfly capabilities` (add `--json` for data) and read it
15
15
  before writing anything. It is generated from the installed library: easings,
16
16
  track kinds, every canvas property with units and ranges, the stick figure's
17
17
  joints, poses, expressions (moods), gags, gaits, beat actions (and the fields
18
- each needs), dances, flips, hand shapes, the code panel's languages, anchors
19
- and edits, camera shots, teaching helpers.
18
+ each needs), dances, flips, hand shapes, the code panel's languages, every surface's
19
+ anchors and edits (code, board, chart), camera shots, teaching helpers.
20
20
 
21
21
  For the how-to, read the docs shipped with the package, at the installed
22
22
  version: `node_modules/@algorisys/tinyfly/llms.txt` (index), `docs/*.md`, or
23
- `llms-full.txt` (everything). For characters acting on code, read
24
- `docs/acting.md` ("Beat scripts" and "Acting on code").
23
+ `llms-full.txt` (everything). For characters acting on code, boards and
24
+ charts, read `docs/acting.md` ("Beat scripts", "Acting on code", "A whole
25
+ scene as data", "Whiteboards", "Charts").
25
26
 
26
27
  At runtime, `describeTarget(target)` says what any target animates (with its
27
28
  current values) and what it can do; `animatableProperties(target)` gives the
@@ -30,7 +31,8 @@ names.
30
31
  ## 2. Write
31
32
 
32
33
  - Prefer the high-level builders: `scriptTracks()` beats for characters,
33
- `codePanel()` for code, `lesson()` and the diagram primitives for teaching
34
+ `codePanel()` for code, `whiteboard()` for lessons on a board,
35
+ `chart()` for bar and line charts, `lesson()` and the diagram primitives for teaching
34
36
  figures, `cameraTracks()` for camera moves. They produce plain JSON tracks.
35
37
  - Aim beats at anchors, never guessed coordinates: `code.line(n)`,
36
38
  `code.token(n, 'word')`, `code.spot(n, column, width)`, `piece.home`,
@@ -41,6 +43,21 @@ names.
41
43
  Canvas `x`/`y` tracks are offsets from where a target was placed. Scene y
42
44
  grows downward. Angles are degrees.
43
45
  - Record code-panel edits before `code.ride(tracks, figureId, { ground })`.
46
+ - For a figure acting on a surface (code panel, whiteboard, chart), prefer
47
+ `surfaceScript(figureId, { name: surface }, beats, options)`: aim beats at
48
+ named places (`target: { surface: 'board', anchor: 'term:eq:+ 4' }`) and put
49
+ the surface's answer on the beat (`then: { surface, edit, anchor, at: 'release' }`).
50
+ A cue's `at` is a moment name (`start`, `contact`, `release`, `end`), never
51
+ ms; `until` sets its length. It records the edits in beat order and rides
52
+ the figure on bars and lines for you. Use `result.tracks` (figure and
53
+ surfaces). Places name items by id: declare them first (`items`, `data`).
54
+ - A figure that starts on the right walking left needs `facing: -1` in the
55
+ script options.
56
+ - A figure changes a prop's state through `propSurface(propTarget(…))`
57
+ (`switch` / `set` on `control:door`, `control:lights`; aim at `anchor:NAME`
58
+ or `part:ID`). Walk figures on a prop's front line (a house's
59
+ `anchor:doorstep` y), not on the prop's own `y`, or they pass through its
60
+ walls.
44
61
  - For objects in the scene (vehicles, trees, houses, aircraft, animals,
45
62
  birds) use the prop presets with `propScript()`; seat figures with
46
63
  `propRide()`, tow with `propTow()`. Aim figure beats at prop anchors
@@ -56,7 +73,9 @@ names.
56
73
  ## 3. Check
57
74
 
58
75
  - Beat scripts: `npx @algorisys/tinyfly check beats.json` (or `checkBeats()`;
59
- `scriptTracks()` throws on the same errors).
76
+ `scriptTracks()` throws on the same errors). Beats with surface places and
77
+ cues: `checkSurfaceBeats(beats, surfaces)` (`surfaceScript()` throws on the
78
+ same errors).
60
79
  - Tracks: `checkTracks(tracks, targets)` — unknown targets and properties,
61
80
  key order, value kinds and ranges.
62
81
  - Teaching timelines: `npx @algorisys/tinyfly validate timeline.json --markup figure.svg`.
@@ -71,5 +90,6 @@ Render stills and look at them before saying it works:
71
90
  npx @algorisys/tinyfly video scene.mjs --stills frames --times 0,800,1600
72
91
  ```
73
92
 
74
- Check that hands meet what they touch, figures stand on their floors, text
75
- lands where it should and nothing leaves the frame. Fix and render again.
93
+ Check that hands meet what they touch, figures face and point the right
94
+ way, stand on their floors (and ride bars as they grow), text lands where it
95
+ should and nothing leaves the frame. Fix and render again.