@algorisys/tinyfly 0.95.0 → 0.98.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.
Files changed (51) hide show
  1. package/README.md +8 -8
  2. package/docs/acting.md +165 -0
  3. package/docs/character-appearance.md +281 -0
  4. package/docs/editor-guide.md +14 -6
  5. package/docs/examples.md +1 -1
  6. package/docs/getting-started.md +1 -1
  7. package/docs/gsap-compat.md +1 -1
  8. package/docs/llm-guide.md +44 -2
  9. package/docs/maps.md +2 -2
  10. package/docs/props.md +8 -6
  11. package/docs/teaching.md +1 -1
  12. package/lib/addons/characters.js +6266 -4087
  13. package/lib/browser/tinyfly.iife.js +16 -14
  14. package/lib/browser/tinyfly.js +8441 -6262
  15. package/lib/browser/tinyfly.umd.js +16 -14
  16. package/lib/types/characters/acting/index.d.ts +1 -0
  17. package/lib/types/characters/acting/surface-script.d.ts +92 -0
  18. package/lib/types/characters/capabilities.d.ts +20 -0
  19. package/lib/types/characters/cast.d.ts +284 -0
  20. package/lib/types/characters/character.d.ts +22 -4
  21. package/lib/types/characters/chart.d.ts +108 -0
  22. package/lib/types/characters/code-panel.d.ts +21 -46
  23. package/lib/types/characters/hands/held-items.d.ts +88 -0
  24. package/lib/types/characters/hands/index.d.ts +1 -0
  25. package/lib/types/characters/head/ears.d.ts +10 -0
  26. package/lib/types/characters/head/facial-hair.d.ts +118 -0
  27. package/lib/types/characters/head/glasses.d.ts +24 -0
  28. package/lib/types/characters/head/hair.d.ts +560 -0
  29. package/lib/types/characters/head/hats.d.ts +58 -0
  30. package/lib/types/characters/head/head-look.d.ts +53 -0
  31. package/lib/types/characters/head/index.d.ts +5 -0
  32. package/lib/types/characters/head/shell.d.ts +64 -0
  33. package/lib/types/characters/index.d.ts +7 -1
  34. package/lib/types/characters/interactions.d.ts +69 -0
  35. package/lib/types/characters/props/families/animals.d.ts +6 -0
  36. package/lib/types/characters/props/index.d.ts +1 -0
  37. package/lib/types/characters/props/prop-surface.d.ts +63 -0
  38. package/lib/types/characters/species/human-motion.d.ts +5 -2
  39. package/lib/types/characters/species/human.d.ts +111 -4
  40. package/lib/types/characters/surface/edit-log.d.ts +47 -0
  41. package/lib/types/characters/surface/index.d.ts +11 -0
  42. package/lib/types/characters/surface/pieces.d.ts +61 -0
  43. package/lib/types/characters/surface/ride.d.ts +31 -0
  44. package/lib/types/characters/surface/surface-box.d.ts +18 -0
  45. package/lib/types/characters/surface/surface.d.ts +79 -0
  46. package/lib/types/characters/wardrobe/basic-outfit.d.ts +19 -5
  47. package/lib/types/characters/whiteboard.d.ts +131 -0
  48. package/llms-full.txt +625 -28
  49. package/llms.txt +29 -28
  50. package/package.json +1 -1
  51. package/skills/tinyfly/SKILL.md +38 -9
package/llms-full.txt CHANGED
@@ -204,7 +204,7 @@ with a GSAP-style call (durations are in seconds here):
204
204
  ```html
205
205
  <div class="box" style="width:60px;height:60px;background:#4a9eff"></div>
206
206
 
207
- <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.95.0/cdn/tinyfly.iife.js"></script>
207
+ <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly.iife.js"></script>
208
208
  <script>
209
209
  tinyfly.to('.box', { x: 200, duration: 1 })
210
210
  </script>
@@ -412,7 +412,7 @@ Without a build step, the all-in-one bundle exposes the same functions on a
412
412
  global — `tinyfly.to()`, `tinyfly.timeline()` and so on:
413
413
 
414
414
  ```html
415
- <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.95.0/cdn/tinyfly.iife.js"></script>
415
+ <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly.iife.js"></script>
416
416
  <script>
417
417
  tinyfly.to('.box', { x: 200, duration: 1 })
418
418
  </script>
@@ -2278,7 +2278,7 @@ For simple website embedding without a build system.
2278
2278
  </html>
2279
2279
  ```
2280
2280
 
2281
- Build the player with `npm run build:player` to generate `lib/player/tinyfly-player.iife.js`, or load it from the CDN: `https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.95.0/cdn/tinyfly-player.iife.js`.
2281
+ Build the player with `npm run build:player` to generate `lib/player/tinyfly-player.iife.js`, or load it from the CDN: `https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly-player.iife.js`.
2282
2282
 
2283
2283
  ---
2284
2284
 
@@ -5545,12 +5545,19 @@ its box; resize the box to change its height. In the property panel:
5545
5545
  traditional stick figure).
5546
5546
  - **Look**: *Clean*, *Pencil* (hand-drawn strokes that boil, with faint
5547
5547
  construction lines) or *Silhouette*.
5548
- - **Build**: *Standard*, *Slim*, *Kid* (big head), *Broad*, *Curvy* or
5549
- *Stocky*, or set **Head**, **Shoulders** and **Hips** with the sliders (the
5550
- Stick figure has a head size only). Clothes, gags, walks and dances fit
5551
- every build.
5548
+ - **Build**: *Standard*, *Slim*, *Kid* (big head), *Child*, *Toddler*, *Tall*,
5549
+ *Short*, *Broad*, *Curvy* or *Stocky*, or set **Head**, **Shoulders**,
5550
+ **Hips**, **Legs** and **Arms** with the sliders (the Stick figure has no
5551
+ shoulders or hips). Clothes, gags, walks and dances fit every build.
5552
5552
  - **Line**, **Skin**, and **Clothes** (a T-shirt and trousers, with their
5553
5553
  colours, or none).
5554
+ - **Head**: **Cast** dresses the character as one of the ready-made cast
5555
+ (boy, girl, young man, young woman, man, woman, grandpa, grandma: build,
5556
+ hair, facial hair, glasses and clothes in one step); then **Hair** (34
5557
+ styles, from buzz cut to twin braids) and its **Hair colour**, **Facial
5558
+ hair** (20 styles), **Glasses**, **Hat** and **Ears** change one thing at a
5559
+ time. Hair and hats turn with the head in every view (see
5560
+ [Character Appearance](character-appearance.md)).
5554
5561
  - **Hands**: *Round*, *Cartoon gloves* (a thumb and three plump fingers), or
5555
5562
  *Natural* (five fingers, best for mudras). Gloves and natural hands take hand
5556
5563
  shapes: dances key them (jazz hands, mudras), and each finger is a track
@@ -5562,7 +5569,8 @@ its box; resize the box to change its height. In the property panel:
5562
5569
  - **Body**: a pose (standing, waving, pointing, cheering, hands on hips,
5563
5570
  thinking, shrugging, sitting, kneeling, crouching, crawling, lying down).
5564
5571
  Poses that rest on a knee, the hands or the back are set down on the ground.
5565
- - **Face**: an expression (happy, sad, surprised, angry…), or the pose's own.
5572
+ - **Face**: an expression (happy, sad, surprised, angry, embarrassed with a
5573
+ blush, crying with tears, afraid with a bead of sweat…), or the pose's own.
5566
5574
 
5567
5575
  To animate a character, pick a view, a pose and a face, and click
5568
5576
  **◆ Keyframe pose at playhead**. Move the playhead, pick the next pose, and
@@ -6466,7 +6474,7 @@ The dialog shows the generated HTML/JavaScript code with a **Copy Code** button.
6466
6474
  **Steps to embed:**
6467
6475
  1. Build the player: `npm run build:player`
6468
6476
  2. Copy `lib/player/tinyfly-player.iife.js` to your project (or load
6469
- `https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.95.0/cdn/tinyfly-player.iife.js`
6477
+ `https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly-player.iife.js`
6470
6478
  instead; see [Deployment](DEPLOYMENT.md))
6471
6479
  3. Copy the generated code into your HTML
6472
6480
  4. Adjust the script `src` path if needed
@@ -7449,11 +7457,11 @@ one probably meant, and `propScript` throws on them.
7449
7457
  | `house()` | `door` (`open`), `lights` (`on`), `smoke` (`for`, runs in the background), `shake` |
7450
7458
  | `helicopter()` | `takeOff` (`height`), `fly` (`to`, `height`), `hover`, `land` |
7451
7459
  | `airplane()` | `takeOff` (`to`, `height`), `fly` (`to`, `height`), `loop`, `land` (`to`) |
7452
- | `horse()` | `walk`, `trot`, `canter`, `gallop` (`to`), `rear`, `buck`, `neigh`, `graze`, `sit`, `jump`, `nod`, `swish` |
7453
- | `dog()` | `walk`, `trot`, `run` (`to`), `bark`, `wag`, `sniff`, `sit`, `jump`, `nod`, `swish` |
7454
- | `cat()` | `walk`, `trot`, `run` (`to`), `meow`, `arch`, `pounce` (`to`), `sit`, `jump`, `nod`, `swish` |
7455
- | `cow()` | `walk`, `trot` (`to`), `moo`, `graze`, `sit`, `jump`, `nod`, `swish` |
7456
- | `songbird()`, `crow()` | `hop`, `walk` (`to`), `peck` (`for`), `flap` (`for`), `fly` (`to`, `height`), `land` (`height`, `to`), `tweet` / `caw` |
7460
+ | `horse()` | `walk`, `trot`, `canter`, `gallop` (`to`), `rear`, `buck`, `neigh`, `graze`, `sit`, `lie`, `jump`, `nod`, `swish` |
7461
+ | `dog()` | `walk`, `trot`, `run` (`to`), `bark`, `wag`, `sniff`, `sit`, `lie`, `jump`, `nod`, `swish` |
7462
+ | `cat()` | `walk`, `trot`, `run` (`to`), `meow`, `arch`, `pounce` (`to`), `sit`, `lie`, `jump`, `nod`, `swish` |
7463
+ | `cow()` | `walk`, `trot` (`to`), `moo`, `graze`, `sit`, `lie`, `jump`, `nod`, `swish` |
7464
+ | `songbird()`, `crow()` | `hop`, `walk` (`to`), `peck` (`for`), `flap` (`for`), `fly` (`to`, `height`), `glide` (`to`, `height`), `land` (`height`, `to`), `tweet` / `caw` |
7457
7465
  | `chicken()` | `walk` (`to`), `peck`, `flap`, `flutter`, `cluck` (it cannot fly) |
7458
7466
 
7459
7467
  **Line art.** `propTarget({ …, style: 'stick' })` (or `drawSolvedProp(…, { style: 'stick' })`)
@@ -7478,7 +7486,9 @@ and while `flapping` is on, the rig's `derive` beats them from a phase,
7478
7486
  a second, a crow four). Its head pecks from a neck joint (`peck`; a chicken's
7479
7487
  neck stretches down to reach), and it walks with its head bobbing or hops.
7480
7488
  `fly` takes off with a crouch and a leap (no crouch if it is already in the
7481
- air) and flies to `height` metres; `land` comes down to the ground or to a
7489
+ air) and flies to `height` metres; `glide` holds the wings out still and sinks
7490
+ gently toward `height` on the way to `to` (from the ground it flies the first
7491
+ stretch); `land` comes down to the ground or to a
7482
7492
  perch (`height`). Perch it with anchors:
7483
7493
 
7484
7494
  ```js
@@ -7565,8 +7575,10 @@ npx @algorisys/tinyfly capabilities --json # the same as data
7565
7575
  It lists the easings, track kinds, every property each canvas shape can
7566
7576
  animate (with units and ranges), the stick figure's joints, poses,
7567
7577
  expressions, gags, gaits, beat actions, dances, flips and hand shapes, the v2
7568
- character's poses, the code panel's languages, anchors and edits, camera
7569
- shots and the teaching helpers. It is generated from the code, so it can't
7578
+ character's poses, expressions, builds, hairstyles, facial hair, glasses,
7579
+ hats and cast, the code panel's languages, every surface's anchors and
7580
+ edits (code panel, whiteboard, chart), camera shots and the teaching
7581
+ helpers. It is generated from the code, so it can't
7570
7582
  fall behind: **a name in it is accepted, and a name not in it is rejected.**
7571
7583
  It is also the last part of `llms-full.txt`.
7572
7584
 
@@ -7590,6 +7602,34 @@ Characters in a 3D scene walk the same way with `characterScript3D`
7590
7602
  (`{ do: 'walk', to: [x, z] }`, `pose`, `gag`, `face`, `place`); a rider is
7591
7603
  seated with `propRide3D` and spliced into its script with `spliceTracks`. See `docs/props.md`.
7592
7604
 
7605
+ ## Characters with a look
7606
+
7607
+ A v2 character's appearance is plain options to `character()`, never drawing
7608
+ code: `build` (`child`, `tall`, `short`…), `hair` (a style name, or
7609
+ `{ style, color, length, … }`), `facialHair`, `glasses`, `hat`, `ears: true`
7610
+ and `outfit: { shirt, trousers }`. `castMember('grandpa', 300)` gives a whole
7611
+ ready-made character to start from. Expressions come from `HUMAN_EXPRESSIONS`
7612
+ and are pose fields, as are the face marks `blush`, `tears` and `sweat` (0–1),
7613
+ so any face goes with any action or view. Hair and hats turn with the head:
7614
+ don't draw a different hairstyle per view. Put things in hands with `holding`
7615
+ (`{ right: 'mug' }`, `{ both: 'parcel' }`; the pose field `held.both` lets go),
7616
+ and for two characters touching use `meetHands('handshake', a, b)` with the
7617
+ two standing `meetingSpacing(…)` apart, never two separate clips. See
7618
+ `docs/character-appearance.md`.
7619
+
7620
+ ## Surfaces
7621
+
7622
+ Code panels (`codePanel()`), whiteboards (`whiteboard()`), charts
7623
+ (`chart()`) and props (`propSurface(propTarget(…))`) are surfaces: their places have names (`line:7`,
7624
+ `token:4:Println`, `text:eq`, `term:eq:+ 4`, `bar:q4`) and their edits are
7625
+ called by name (`surface.edit('highlight', 'line:4', { at })`). Write a scene
7626
+ on one with `surfaceScript()`: beats aim at `{ surface, anchor }` and say what
7627
+ the surface does in answer with `then`, at a moment of the beat (`at:
7628
+ 'contact'`, `'release'`…). A whiteboard's texts and marks and a chart's data
7629
+ are declared up front, each with an id the places use. The catalog lists each
7630
+ surface's places and edits. See "A whole scene as data", "Whiteboards" and
7631
+ "Charts" in `docs/acting.md`.
7632
+
7593
7633
  ## Your own behaviours
7594
7634
 
7595
7635
  Write new actions with `defineAction()` (from beats, or as timed pose steps),
@@ -7656,14 +7696,26 @@ Fix, render again.
7656
7696
  positions. A beat script's `to` is a scene x, and its tracks are offsets
7657
7697
  from `from` (and `ground` for y).
7658
7698
  - **Scene y grows downward.** A floor higher up the screen has a smaller y.
7699
+ - **Walk figures in front of props, not through them.** A prop stands on its
7700
+ middle; its front comes forward of that. Use its front line as the
7701
+ figure's `ground` (a house's `anchor:doorstep`).
7659
7702
  - **Angles are degrees.** Stick-figure arms: 0 hangs down, 90 straight out,
7660
7703
  180 straight up; in profile the left arm's forward is negative.
7704
+ - **A character's look is data, and names are checked.** `hair: 'bob'`, not
7705
+ a drawing in `layers`; a style name not in the catalog throws (`hair:
7706
+ unknown style`). Side names (`at: 'left'`, `arm.left`) are the character's
7707
+ own: from the front its left is on screen right.
7661
7708
  - **Aim beats at anchors, not guessed numbers**: `code.line(7)`,
7662
7709
  `code.token(3, 'var')`, `code.spot(2, 8, 4)`, `piece.home`.
7663
7710
  - **Key reactions to contact times.** Beats that touch something report
7664
7711
  `result.beats[i].contact` (and `release`): wipe the line, fling the word or
7665
7712
  type the text at those times.
7666
7713
  - **Record panel edits before `code.ride()`**, which reads the moves they make.
7714
+ - **Or write it all as data with `surfaceScript`**: name places
7715
+ (`target: { surface: 'code', anchor: 'token:3:var' }`) and put the surface's
7716
+ answer on the beat (`then: { surface: 'code', edit: 'fling', anchor: 'token:3:var', at: 'release' }`).
7717
+ A cue's `at` is a moment name (`start`, `contact`, `release`, `end`), never
7718
+ ms. It records the edits and rides the lines for you, in beat order.
7667
7719
 
7668
7720
  ## Set up your assistant
7669
7721
 
@@ -7725,7 +7777,7 @@ path for all of that:
7725
7777
  </figure>
7726
7778
 
7727
7779
  <!-- once, anywhere on the page (a site-wide footer is fine) -->
7728
- <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.95.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
7780
+ <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
7729
7781
  ```
7730
7782
 
7731
7783
  Every `[data-tinyfly-embed]` mounts when the page is ready, with no per-post
@@ -8800,8 +8852,8 @@ On a page with no build step, load the maps add-on after the browser bundle; it
8800
8852
  adds to the same `tinyfly` global:
8801
8853
 
8802
8854
  ```html
8803
- <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.95.0/cdn/tinyfly.iife.js"></script>
8804
- <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.95.0/cdn/tinyfly-maps.iife.js"></script>
8855
+ <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly.iife.js"></script>
8856
+ <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly-maps.iife.js"></script>
8805
8857
  ```
8806
8858
 
8807
8859
  It is a separate script because the offline world map it carries adds about
@@ -9004,6 +9056,292 @@ prop, or the depths to slot it between fingers.
9004
9056
 
9005
9057
  ---
9006
9058
 
9059
+ <!-- docs/character-appearance.md -->
9060
+
9061
+ # Character Appearance
9062
+
9063
+ Hair, facial hair, glasses, hats, ears, builds, a ready-made cast, held items
9064
+ and meeting hands for the v2 character (`character()` in `@algorisys/tinyfly/characters`). Every choice
9065
+ is plain data, so a character can be saved, synced, generated by a language
9066
+ model and changed one field at a time.
9067
+
9068
+ ![Character appearance sheet: the cast, every hairstyle, facial-hair style, glasses, hats and expressions](model-sheet/appearance.png)
9069
+
9070
+ The sheet is drawn by `examples/headless-video/appearance-sheet.mjs`
9071
+ (`npx tinyfly video examples/headless-video/appearance-sheet.mjs --stills stills/`).
9072
+
9073
+ ## Quick start
9074
+
9075
+ ```js
9076
+ import { character, characterTarget, drawCharacter, humanPose, castMember, HUMAN_EXPRESSIONS } from '@algorisys/tinyfly/characters'
9077
+
9078
+ // Pick everything by name…
9079
+ const maya = character({
9080
+ height: 300,
9081
+ build: 'slim',
9082
+ hair: { style: 'highPonytail', color: '#9a4426' },
9083
+ glasses: 'round',
9084
+ ears: true,
9085
+ outfit: { shirt: '#f0b43c', trousers: '#36507a' },
9086
+ })
9087
+
9088
+ // …or start from the cast and change what you like.
9089
+ const grandpa = character(castMember('grandpa', 300, { look: 'pencil' }))
9090
+
9091
+ // Faces are pose fields, so any expression goes with any action and view.
9092
+ drawCharacter(ctx, maya, humanPose({ ...HUMAN_EXPRESSIONS.embarrassed, turn: 0.5 }))
9093
+ ```
9094
+
9095
+ A plain figure (no `hair`, `facialHair`, `glasses`, `hat` or `ears`) draws
9096
+ exactly as it did before these options existed.
9097
+
9098
+ ## How it turns
9099
+
9100
+ Hair, beards and hats are not flat drawings pasted on the face. Each is a
9101
+ region on the head's surface (where the hairline runs, how far the hair stands
9102
+ off the head, how far it hangs), drawn wherever the head's `turn`, `head.turn`,
9103
+ `head.nod` and `head.tilt` put it:
9104
+
9105
+ - the part facing away is drawn before the body, so long hair hangs behind the
9106
+ shoulders seen from the front, and a bob shows beside the face;
9107
+ - the part facing the viewer is drawn over the head, so a fringe crosses the
9108
+ forehead and, from behind, the hair covers the whole head;
9109
+ - turned away (past about `turn` 1.2), the hair is drawn after the whole body,
9110
+ over an arm at the side;
9111
+ - a parting, a side ponytail or a braid stays on the character's own side
9112
+ through a turn: left and right are the character's, never mirrored.
9113
+
9114
+ Glasses, moustaches and the face marks sit on the face itself, placed like the
9115
+ eyes and mouth, so they slide round with the face and hide with it.
9116
+
9117
+ **Which part wins where two overlap** is fixed: eyes and brows draw over a
9118
+ fringe; the mouth draws over a beard, which leaves an opening for it (so every
9119
+ lip-sync shape stays readable); a moustache draws over the top of the mouth;
9120
+ glasses over the eyes; a hat over the hair. Ears are hidden by hair that
9121
+ `coversEars`.
9122
+
9123
+ ## Views
9124
+
9125
+ `turn` runs 0 → 4. The eight reference views:
9126
+
9127
+ | View | `turn` |
9128
+ |---|---|
9129
+ | Front | 0 |
9130
+ | Front 3/4 right (nose toward screen right) | 0.5 |
9131
+ | Right profile | 1 |
9132
+ | Back 3/4 right | 1.5 |
9133
+ | Back | 2 |
9134
+ | Back 3/4 left | 2.5 |
9135
+ | Left profile | 3 |
9136
+ | Front 3/4 left | 3.5 |
9137
+
9138
+ The view names describe the screen; limb and side names (`arm.left`,
9139
+ `at: 'left'`) are always the character's own.
9140
+
9141
+ ## Hair
9142
+
9143
+ `hair` takes a style name, a style with changes, or `null`:
9144
+
9145
+ ```js
9146
+ character({ hair: 'bob' })
9147
+ character({ hair: { style: 'bob', color: HAIR_COLORS.auburn, length: 1.4 } })
9148
+ character({ hair: { volume: 0.2, hairline: { front: 0.3 }, ties: [{ kind: 'bun', at: 'top' }] } })
9149
+ ```
9150
+
9151
+ Short cuts and hairlines: `bald`, `buzzCut`, `crewCut`, `short`, `sidePart`,
9152
+ `sideSwept`, `slickBack`, `quiff`, `spiky`, `undercut`, `curlyCrop`, `afro`,
9153
+ `wavyCrop`, `shortLocs`, `flatTop`, `receding`, `thinning`.
9154
+
9155
+ Medium and long hair: `pixie`, `bob`, `longBob`, `wavyBob`, `shoulderStraight`,
9156
+ `shoulderWaves`, `longStraight`, `longWaves`, `longCurls`, `longLocs`,
9157
+ `lowPonytail`, `highPonytail`, `ponytail`, `sidePonytail`, `topBun`, `lowBun`,
9158
+ `singleBraid`, `twinBraids`, `braids`.
9159
+
9160
+ Every style is the same few fields (`resolveHair(spec)` fills them all in):
9161
+
9162
+ | Field | Meaning |
9163
+ |---|---|
9164
+ | `color` | Fill colour. `HAIR_COLORS` has `black`, `brown`, `chestnut`, `auburn`, `blond`, `ginger`, `gray`, `white` |
9165
+ | `volume` | How far the hair stands off the head (head radii) |
9166
+ | `hairline` | `{ front, side, back }`: its height at the forehead, temples and nape (head radii, +up from the head's centre) |
9167
+ | `sweep` | A side fringe: the hairline drops toward the character's left (+) or right (−) |
9168
+ | `recede` | Temples pushed back |
9169
+ | `length` | Long hair: where it ends, head radii below the head's centre (`0` short; about 1.75 is the shoulders) |
9170
+ | `opening` | Long hair: half the opening left for the face, degrees |
9171
+ | `texture`, `textureAmount` | `smooth`, `spiky`, `curly`, `wavy` or `locs`, and how strong |
9172
+ | `quiff`, `flat` | Volume swept up over the forehead; a flat top's height |
9173
+ | `part`, `strands` | A parting (degrees round from the middle of the face) and the detail lines: `none`, `part`, `sweep`, `combed`, `hanging`, `thin` |
9174
+ | `fill` | `solid`, or `stipple` (close-cropped: dots on the scalp) |
9175
+ | `ties` | Ponytails, buns and braids: `{ kind: 'ponytail' \| 'bun' \| 'braid', at: 'top' \| 'high' \| 'low' \| 'left' \| 'right', length?, size? }` |
9176
+ | `coversEars` | The hair hides the ears |
9177
+
9178
+ A style stays a starting point: any style suits anyone.
9179
+
9180
+ ## Facial hair
9181
+
9182
+ `facialHair` takes a style name or `{ moustache, beard, color }` (the colour
9183
+ defaults to the hair's):
9184
+
9185
+ `cleanShaven`, `stubble`, `pencilMoustache`, `shortMoustache`, `chevron`,
9186
+ `handlebar`, `walrus`, `goatee`, `vanDyke`, `circleBeard`, `shortBoxed`,
9187
+ `fullBeard`, `longBeard`, `roundedBeard`, `pointedBeard`, `chinStrap`,
9188
+ `soulPatch`, `sideburns`, `muttonChops`, `moustacheStubble`.
9189
+
9190
+ Moustaches: `none`, `pencil`, `short`, `chevron`, `handlebar`, `walrus`.
9191
+ Beards: `none`, `stubble`, `goatee`, `soulPatch`, `chinStrap`, `circle`,
9192
+ `boxed`, `full`, `rounded`, `pointed`, `long`, `sideburns`, `muttonChops`.
9193
+
9194
+ ## Glasses, hats and ears
9195
+
9196
+ - `glasses`: `round`, `square`, `sunglasses` (drawn in the ink; the near arm
9197
+ runs back to the ear in profile).
9198
+ - `hat`: `cap`, `beanie`, `hardHat`, `sunHat`, `bowler`, or `{ style, color }`.
9199
+ The crown sits over the hair; hair below the brim still shows.
9200
+ - `ears: true` adds ears: they stick out past the head from the front and
9201
+ behind, and sit on the head with a curl when turned toward the viewer.
9202
+
9203
+ ## Builds
9204
+
9205
+ `build` sets proportions; `height` sets how tall the character stands. Any
9206
+ field can still be set on its own (`headSize`, `shoulderWidth`, `hipWidth`,
9207
+ `legLength`, `armLength`).
9208
+
9209
+ | Build | What changes |
9210
+ |---|---|
9211
+ | `standard` | Nothing |
9212
+ | `slim` | Smaller head, narrower |
9213
+ | `tall` | Smaller head, longer legs and arms |
9214
+ | `short` | Larger head, shorter legs, a little wider |
9215
+ | `broad`, `curvy`, `stocky` | Shoulder and hip widths (stocky: a larger head) |
9216
+ | `kid`, `child`, `toddler` | Larger head, shorter limbs |
9217
+
9218
+ Age, posture and accessories are separate choices: a child build is only
9219
+ proportions, and an older character is shown by hair and glasses, never by a
9220
+ stoop unless one is posed. The same poses, gaits and actions work on every
9221
+ build; `humanGaitStrideLength(gait, height, stride, legLength)` gives a build's
9222
+ stride so its feet stay planted.
9223
+
9224
+ ## Clothes
9225
+
9226
+ `outfit` dresses the character as data (any `layers` are drawn over it):
9227
+
9228
+ ```js
9229
+ character({ outfit: { shirt: '#7a8fa6', trousers: '#3b3f46', sleeves: 'long', collar: true, tie: '#2b4f8c' } })
9230
+ character({ outfit: { bottom: 'skirt' } })
9231
+ character({ outfit: { over: 'labCoat' } })
9232
+ ```
9233
+
9234
+ | Field | Choices |
9235
+ |---|---|
9236
+ | `shirt`, `trousers` | Colours (the trousers' colour also colours shorts and a skirt) |
9237
+ | `sleeves` | `short` (default), `long`, `none` |
9238
+ | `bottom` | `trousers` (default), `shorts`, `skirt` |
9239
+ | `collar` | `true` for a shirt collar |
9240
+ | `tie` | A colour, for a tie down the front |
9241
+ | `over`, `overColor` | `apron` or `labCoat`, and its colour |
9242
+
9243
+ The front details (collar, tie, apron, the coat's opening) show from the
9244
+ front and turn away with the body; from behind an apron shows its ties.
9245
+ `basicOutfit(options)` gives the same clothes as layers.
9246
+
9247
+ ## The cast
9248
+
9249
+ `castMember(name, height, changes?)` returns character options for a recurring
9250
+ cast member at an adult `height` (each stands at their own scale of it). The
9251
+ family: `boy`, `girl`, `youngMan`, `youngWoman`, `man`, `woman`, `grandpa`,
9252
+ `grandma`; at work (from the occupations sheet): `doctor`, `cook`, `builder`,
9253
+ `courier`, `teacher`, `farmer`. `CHARACTER_CAST` has each one's `label`,
9254
+ `group` (`family` or `work`), `scale` and `options`.
9255
+
9256
+ ```js
9257
+ const family = ['man', 'woman', 'girl', 'grandma'].map((name) => character(castMember(name, 280)))
9258
+ ```
9259
+
9260
+ ## Expressions and face marks
9261
+
9262
+ `HUMAN_EXPRESSIONS` sets every face field, so applying one replaces the whole
9263
+ face, and any two blend. Besides the stick figure's faces (`neutral`, `happy`,
9264
+ `joyful`, `sad`, `crying`, `surprised`, `shocked`, `angry`, `furious`,
9265
+ `worried`, `scared`, `confused`, `skeptical`, `thinking`, `sleepy`,
9266
+ `disgusted`, `smug`, `wink`) there are `laughing`, `afraid`, `bored`, `tired`,
9267
+ `embarrassed`, `proud`, `determined`, `affectionate`, `hurt`, `suspicious`,
9268
+ `relieved` and `excited`.
9269
+
9270
+ Three face marks fade in from 0 to 1 and are pose fields like any other (so
9271
+ tracks animate them): `blush` (rosy cheeks, with hatch lines past 0.5),
9272
+ `tears` (a drop under each eye, running down past 0.6) and `sweat` (a bead at
9273
+ the temple).
9274
+
9275
+ ## Everyday actions, held items and meeting hands
9276
+
9277
+ The motion and everyday-life sheets add poses to `HUMAN_POSES`: `sleep`,
9278
+ `stretch`, `sitFloor` (cross-legged), `carry`, `lift`, `push`, `pull`,
9279
+ `drink`, `phone`, `read` and `type` (seated, for a desk). Like every pose they
9280
+ blend, turn and take any face.
9281
+
9282
+ **Holding things.** `holding` puts an item in a hand, as data:
9283
+
9284
+ ```js
9285
+ character({ holding: { right: 'mug' } }) // drink
9286
+ character({ holding: { left: 'bag', right: 'bag' } }) // carry
9287
+ character({ holding: { both: { item: 'parcel', color: '#c9a06a' } } })
9288
+ ```
9289
+
9290
+ Items: `mug`, `phone`, `briefcase`, `bag`, `umbrella` and `broom` (one hand,
9291
+ `left` or `right`), `book` (one hand or `both`) and `parcel` (`both`). Each is
9292
+ drawn at the hand's grip, so it follows the hand through any pose, gait or
9293
+ turn, and sorts with that arm (a mug goes behind the body with the far arm).
9294
+ An umbrella's canopy sits just over the head. `handGrip(joints, side)` gives
9295
+ the grip point and the forearm's direction for drawing anything else in a
9296
+ hand.
9297
+
9298
+ Whether an item shows is a pose field, `held.left`, `held.right` or
9299
+ `held.both` (1 by default; below 0.5 it has been let go), so a track lets go
9300
+ of it at a moment: a parcel handed over is the giver's `held.both` going to 0
9301
+ as the taker's goes to 1.
9302
+
9303
+ **Meeting hands.** `meetHands(kind, a, b, options?)` poses two characters so
9304
+ their hands meet at one point, rather than playing two clips and hoping they
9305
+ line up: `handshake`, `highFive`, `fistBump` and `handOver` (four hands round
9306
+ one parcel). Each partner is `{ character, x, pose? }` on the same ground
9307
+ line; the one on the left turns to face right and the other left,
9308
+ three-quarters on (`view: 'side'` for profiles). Stand them
9309
+ `meetingSpacing(kind, a, b)` apart; the result's `reached` says whether both
9310
+ got there.
9311
+
9312
+ ```js
9313
+ const gap = meetingSpacing('handOver', courier, neighbour)
9314
+ const give = meetHands('handOver', { character: courier, x: 300 }, { character: neighbour, x: 300 + gap })
9315
+ // give.a and give.b are poses to key; give.point is where the parcel is.
9316
+ ```
9317
+
9318
+ ## In the editor
9319
+
9320
+ Select a 🧍 Character and open **Head** in the properties: **Cast** dresses it
9321
+ as a cast member (build, hair, facial hair, glasses and clothes in one step),
9322
+ then **Hair**, **Hair colour**, **Facial hair**, **Glasses**, **Hat** and
9323
+ **Ears** change one thing at a time; **Right hand**, **Left hand** and **Both
9324
+ hands** put an item in them. **Build** lists the builds, with **Legs** and
9325
+ **Arms** sliders. The new expressions and everyday poses are in the **Face**
9326
+ and **Body** lists. All of it is saved as plain fields on the element and
9327
+ exported to video and GIF.
9328
+
9329
+ ## In the gallery
9330
+
9331
+ - **Cast Turnaround**: the whole cast turning through all eight views together.
9332
+ - **Hair, Beards & Hats**: pick a style, colour, facial hair, glasses, hat and
9333
+ face, and see the character turning and in all eight views at once.
9334
+ - **Hand Over**: a courier walks up and hands a parcel over (`meetHands`,
9335
+ `holding`, `held.both`).
9336
+
9337
+ ## Determinism
9338
+
9339
+ Outlines are traced from the same numbers every time (no randomness, no state
9340
+ between frames), so a frame at a given time always draws the same, and the
9341
+ pencil look's boil stays seeded as before.
9342
+
9343
+ ---
9344
+
9007
9345
  <!-- docs/acting.md -->
9008
9346
 
9009
9347
  # Cartoon Acting
@@ -9445,6 +9783,171 @@ writes them out as one track per prop (`line.N.highlight`, `line.N.strike`,
9445
9783
  keyword lists for Go, Rust, C#, JavaScript, TypeScript and Python (strings,
9446
9784
  numbers and line comments too); `plain` leaves the text uncoloured.
9447
9785
 
9786
+ ### Places and edits by name
9787
+
9788
+ A code panel is a *surface*: every place on it has a name, so a scene can be
9789
+ written as plain data. `anchor(name)` gives the box there, `piece(name)` the
9790
+ word there, and `edit(name, anchor, options)` does the same as the methods
9791
+ above:
9792
+
9793
+ ```js
9794
+ code.anchor('line:7') // = code.line(7)
9795
+ code.anchor('token:4:Println') // = code.token(4, 'Println'); token:4#2:x is the second x
9796
+ code.anchor('spot:3:4') // = code.spot(3, 4)
9797
+
9798
+ code.edit('highlight', ['line:2', 'line:3'], { at: 100 })
9799
+ code.edit('fling', 'token:4:Println', { at: grab.release })
9800
+ code.edit('drop', 'token:1:int', { at: 1600, into: 'spot:3:2' })
9801
+ code.edit('move', 'token:4:fmt.', { at: 600, to: 'box' })
9802
+ ```
9803
+
9804
+ A wrong name says what it meant (`Unknown anchor "lin": did you mean "line"?`),
9805
+ and an edit given the wrong kind of place says which kind it takes. The
9806
+ anchors and edits are listed under "Surfaces" in `capabilities()`. Boards,
9807
+ charts and props that change state are planned as surfaces that work the
9808
+ same way.
9809
+
9810
+ ### A whole scene as data
9811
+
9812
+ `surfaceScript()` takes beats that name places and say what the surface does
9813
+ in answer, so the reactions above need no wiring by hand. A beat's `target`,
9814
+ `to` and `onto` can be a place (`{ surface, anchor }`: its box, its centre x,
9815
+ its top), and `then` holds the surface's cues, each at a moment of the beat:
9816
+
9817
+ ```js
9818
+ const result = surfaceScript('hero', { code }, [
9819
+ { do: 'leap', to: 300, onto: { surface: 'code', anchor: 'line:5' } },
9820
+ { do: 'grab', target: { surface: 'code', anchor: 'token:4:Println' },
9821
+ then: { surface: 'code', edit: 'carry', anchor: 'token:4:Println', until: { beat: 2, at: 'release' } } },
9822
+ { do: 'throw', to: 700,
9823
+ then: { surface: 'code', edit: 'fling', anchor: 'token:4:Println', at: 'release' } },
9824
+ { do: 'swipe', target: { surface: 'code', anchor: 'line:2' },
9825
+ then: { surface: 'code', edit: 'remove', anchor: 'line:2', style: 'blur', duration: 600 } },
9826
+ ], { from: 600, ground: code.box.bottom, height: 100 })
9827
+
9828
+ const timeline = deserializeTimeline({ id: 'scene', tracks: result.tracks })
9829
+ ```
9830
+
9831
+ A cue's `at` is `start`, `contact`, `release` or `end` (default: the beat's
9832
+ contact, or its start when it has none). `until` ends it at a moment of the
9833
+ same beat or of a later one (`{ beat: 2, at: 'release' }`) and sets the
9834
+ edit's duration. Every other field is the edit's own option (`text`, `into`,
9835
+ `style`, `on`). `carry` is the one cue that is not a surface edit: the piece
9836
+ follows the figure's hand (`handPath`) until `until`; pass `figureStyle` when
9837
+ the figure is drawn with more than a `height`.
9838
+
9839
+ It does what the hand-wired version does, in the same order: the beats go to
9840
+ `scriptTracks` with places swapped for their boxes as laid out, each cue runs
9841
+ `surface.edit()` in beat order, and the figure rides the surfaces it stands
9842
+ on (`ride: false` turns that off). The Code Tidy demo written this way gives
9843
+ the same tracks, key for key. `result.tracks` holds the figure's tracks and
9844
+ every surface's (named by its key in `{ code }`); `checkSurfaceBeats(beats, surfaces)`
9845
+ lists the problems without compiling.
9846
+
9847
+ ### Whiteboards
9848
+
9849
+ `whiteboard()` is a second surface, for lessons that are not code: a board
9850
+ (or `theme: 'chalkboard'`) whose texts and hand-drawn marks are declared as
9851
+ data, each with an id, and named as places like a code panel's lines:
9852
+
9853
+ ```js
9854
+ const board = whiteboard({
9855
+ x: 20, y: 20, width: 470, height: 300, theme: 'chalkboard', fontSize: 30,
9856
+ items: [
9857
+ { id: 'eq', text: '2x + 4 = 12', at: [40, 30] },
9858
+ { id: 'move', text: '2x = 12 - 4', at: [40, 100], hidden: true },
9859
+ { id: 'ring', mark: 'circle', around: 'term:eq:+ 4', hidden: true },
9860
+ { id: 'across', mark: 'arrow', from: 'mark:ring', to: 'term:move:- 4', color: 'orange', hidden: true },
9861
+ ],
9862
+ })
9863
+
9864
+ surfaceScript('teacher', { board }, [
9865
+ { do: 'point', target: { surface: 'board', anchor: 'term:eq:+ 4' },
9866
+ then: { surface: 'board', edit: 'draw', anchor: 'mark:ring', until: 'end' } },
9867
+ { do: 'write', target: { surface: 'board', anchor: 'text:move' },
9868
+ then: { surface: 'board', edit: 'write', anchor: 'text:move', until: 'release' } },
9869
+ ], { from: 640, ground: 400, height: 190, facing: -1 })
9870
+ ```
9871
+
9872
+ Its places are `box`, `text:ID`, `term:ID:TEXT` (part of a text; `term:ID#K:TEXT`
9873
+ for the Kth) and `mark:ID`. Marks are `circle`, `box`, `underline` (each
9874
+ `around` a place) and `arrow` (`from` one place `to` another), and can only
9875
+ name items declared before them. Its edits: `write` (a hidden text, by hand;
9876
+ or new `text` into a term's place), `draw` (a hidden mark), `erase`, `strike`,
9877
+ and `move` and `fling` for a term, which comes loose as a piece (`carry` works
9878
+ too). Text is laid out in fixed-width cells, never measured, and each mark's
9879
+ wobble comes from a seed made of its id, so a board is drawn the same
9880
+ everywhere. Colours are theme names (`red`, `blue`, `green`, `orange`, and
9881
+ `yellow` on chalk) or any CSS colour. The Board Lesson demo solves an
9882
+ equation this way.
9883
+
9884
+ ### Charts
9885
+
9886
+ `chart()` is a surface for talking through data: a bar or line chart whose
9887
+ values are declared as data, scaled once when it is made (`max`, or a round
9888
+ number above the largest value).
9889
+
9890
+ ```js
9891
+ const sales = chart({
9892
+ x: 20, y: 20, width: 480, height: 340, kind: 'bar', theme: 'dark', title: 'Sales', max: 100, suffix: 'k',
9893
+ data: [
9894
+ { id: 'q3', label: 'Q3', value: 30 },
9895
+ { id: 'q4', label: 'Q4', value: 20 },
9896
+ ],
9897
+ })
9898
+
9899
+ surfaceScript('hero', { sales }, [
9900
+ { do: 'point', target: { surface: 'sales', anchor: 'bar:q3' },
9901
+ then: { surface: 'sales', edit: 'highlight', anchor: 'bar:q3' } },
9902
+ { do: 'leap', to: { surface: 'sales', anchor: 'bar:q4' }, onto: { surface: 'sales', anchor: 'bar:q4' } },
9903
+ { do: 'cheer', for: 1600,
9904
+ then: { surface: 'sales', edit: 'set', anchor: 'bar:q4', value: 85, at: 'start', until: 'end' } },
9905
+ ], { from: 640, ground: 400, height: 90, facing: -1 })
9906
+ ```
9907
+
9908
+ Its places are `bar:ID` (on a bar chart) or `point:ID` (on a line chart),
9909
+ `label:ID`, `value:ID` and `box`, and they follow the values:
9910
+ `sales.anchor('bar:q4', time)` is the bar as it stands then. Its edits:
9911
+ `set` (a new `value`; the value label counts along), `show` (grow a
9912
+ `hidden` bar in from the axis, or draw the line out to a point; `on: false`
9913
+ takes it back) and `highlight`. A bar's top is a floor: a figure standing on
9914
+ it is carried up and down as it grows and shrinks, as in the Chart Talk demo.
9915
+
9916
+ ### Props as surfaces
9917
+
9918
+ A prop's controls are state a figure can change: `propSurface(propTarget(…))`
9919
+ makes a car, a house or a tree a surface. Its places are `anchor:NAME` (the
9920
+ rig's anchors: `door`, `doorstep`, `seat`, `branch`…), `part:ID` (one part as
9921
+ seen: `window-1`, `wheel-0-left`), `control:NAME` (where the parts a control
9922
+ moves or lights are) and `box`. Its edits are `set` (a control to a `value`)
9923
+ and `switch` (a control to its full value, open or on, or back to rest with
9924
+ `on: false`).
9925
+
9926
+ ```js
9927
+ const home = propTarget({ x: 430, y: 320, prop: house(), values: { turn: 0.25 } })
9928
+ const homeSurface = propSurface(home)
9929
+ const floor = homeSurface.anchor('anchor:doorstep').y
9930
+
9931
+ surfaceScript('hero', { home: homeSurface }, [
9932
+ { do: 'walk', to: homeSurface.anchor('anchor:door').x - 70 },
9933
+ { do: 'grab', target: { surface: 'home', anchor: 'anchor:door' },
9934
+ then: { surface: 'home', edit: 'switch', anchor: 'control:door', until: 'end' } },
9935
+ { do: 'point', target: { surface: 'home', anchor: 'part:window-1' },
9936
+ then: { surface: 'home', edit: 'switch', anchor: 'control:lights' } },
9937
+ ], { from: 40, ground: floor, height: 100 })
9938
+ ```
9939
+
9940
+ A prop stands on its middle, and seen from a little above its front comes
9941
+ forward of that line. A figure that walks on the prop's own `y` is inside
9942
+ its footprint and seems to walk through the wall; walk it on the prop's
9943
+ front line instead (a house's `doorstep`, as above). Places are worked out
9944
+ from the prop's values at a time, so they follow a door as it swings; pass
9945
+ the prop's own script as `propSurface(target, { tracks })` and they follow
9946
+ it as it drives off. Do not key a control both in its own script and here.
9947
+ A part turned away from the viewer has no place on screen (a car's
9948
+ headlights in profile); the error names the anchors to aim at instead. The
9949
+ Home Time demo is this scene.
9950
+
9448
9951
  ## Camera
9449
9952
 
9450
9953
  Video scenes can be seen through a camera: `camera: true` reads the tracks of
@@ -12744,7 +13247,7 @@ magnet.addEventListener('pointerleave', () => {
12744
13247
 
12745
13248
  <!-- capabilities: generated from the library -->
12746
13249
 
12747
- # tinyfly capabilities (v0.95.0)
13250
+ # tinyfly capabilities (v0.98.0)
12748
13251
 
12749
13252
  Generated from the library itself: every name below is accepted, and names not listed are rejected (beat scripts, code panels and `checkTracks` say which name was probably meant).
12750
13253
 
@@ -12994,17 +13497,29 @@ Prop beat fields: `do`, `at`, `for`, `to`, `toward`, `speed`, `open`, `on`, `hei
12994
13497
  | `house()` | building | `door` (open), `lights` (on), `shake`, `smoke` | `door`, `lights` | door, doorstep, ridge, chimney |
12995
13498
  | `helicopter()` | aircraft | `takeOff`, `fly` (to), `hover`, `land` | `rotor`, `blur` | seat, door, rotor, skids, hook |
12996
13499
  | `airplane()` | aircraft | `takeOff` (to), `fly` (to), `loop`, `land` (to) | `rotor`, `blur` | seat, nose, tail, wingtip |
12997
- | `horse()` | animal | `walk` (to), `trot` (to), `canter` (to), `gallop` (to), `neigh`, `sit`, `jump`, `nod`, `swish`, `graze`, `rear`, `buck` | `walk`, `walking`, `gait`, `neck`, `tail`, `wag`, `fl.swing`, `fl.knee`, `fl.ankle`, `fr.swing`, `fr.knee`, `fr.ankle`, `hl.swing`, `hl.knee`, `hl.ankle`, `hr.swing`, `hr.knee`, `hr.ankle` | back, head, mouth, front, hitch, saddle |
12998
- | `dog()` | animal | `walk` (to), `trot` (to), `run` (to), `gallop` (to), `bark`, `sit`, `jump`, `nod`, `swish`, `wag`, `sniff` | `walk`, `walking`, `gait`, `neck`, `tail`, `wag`, `fl.swing`, `fl.knee`, `fl.ankle`, `fr.swing`, `fr.knee`, `fr.ankle`, `hl.swing`, `hl.knee`, `hl.ankle`, `hr.swing`, `hr.knee`, `hr.ankle` | back, head, mouth, front, leash |
12999
- | `cat()` | animal | `walk` (to), `trot` (to), `run` (to), `gallop` (to), `meow`, `sit`, `jump`, `nod`, `swish`, `arch`, `pounce` (to) | `walk`, `walking`, `gait`, `neck`, `tail`, `wag`, `fl.swing`, `fl.knee`, `fl.ankle`, `fr.swing`, `fr.knee`, `fr.ankle`, `hl.swing`, `hl.knee`, `hl.ankle`, `hr.swing`, `hr.knee`, `hr.ankle` | back, head, mouth, front |
13000
- | `cow()` | animal | `walk` (to), `trot` (to), `moo`, `sit`, `jump`, `nod`, `swish`, `graze` | `walk`, `walking`, `gait`, `neck`, `tail`, `wag`, `fl.swing`, `fl.knee`, `fl.ankle`, `fr.swing`, `fr.knee`, `fr.ankle`, `hl.swing`, `hl.knee`, `hl.ankle`, `hr.swing`, `hr.knee`, `hr.ankle` | back, head, mouth, front |
13001
- | `songbird()` | bird | `hop` (to), `walk` (to), `peck`, `flap`, `tweet`, `fly` (to), `land` | `spread`, `flap`, `wingbeat`, `flapping`, `peck`, `step`, `stepping`, `leg.left`, `leg.right` | beak, head, back, feet |
13002
- | `crow()` | bird | `hop` (to), `walk` (to), `peck`, `flap`, `caw`, `fly` (to), `land` | `spread`, `flap`, `wingbeat`, `flapping`, `peck`, `step`, `stepping`, `leg.left`, `leg.right` | beak, head, back, feet |
13500
+ | `horse()` | animal | `walk` (to), `trot` (to), `canter` (to), `gallop` (to), `neigh`, `sit`, `lie`, `jump`, `nod`, `swish`, `graze`, `rear`, `buck` | `walk`, `walking`, `gait`, `neck`, `tail`, `wag`, `fl.swing`, `fl.knee`, `fl.ankle`, `fr.swing`, `fr.knee`, `fr.ankle`, `hl.swing`, `hl.knee`, `hl.ankle`, `hr.swing`, `hr.knee`, `hr.ankle` | back, head, mouth, front, hitch, saddle |
13501
+ | `dog()` | animal | `walk` (to), `trot` (to), `run` (to), `gallop` (to), `bark`, `sit`, `lie`, `jump`, `nod`, `swish`, `wag`, `sniff` | `walk`, `walking`, `gait`, `neck`, `tail`, `wag`, `fl.swing`, `fl.knee`, `fl.ankle`, `fr.swing`, `fr.knee`, `fr.ankle`, `hl.swing`, `hl.knee`, `hl.ankle`, `hr.swing`, `hr.knee`, `hr.ankle` | back, head, mouth, front, leash |
13502
+ | `cat()` | animal | `walk` (to), `trot` (to), `run` (to), `gallop` (to), `meow`, `sit`, `lie`, `jump`, `nod`, `swish`, `arch`, `pounce` (to) | `walk`, `walking`, `gait`, `neck`, `tail`, `wag`, `fl.swing`, `fl.knee`, `fl.ankle`, `fr.swing`, `fr.knee`, `fr.ankle`, `hl.swing`, `hl.knee`, `hl.ankle`, `hr.swing`, `hr.knee`, `hr.ankle` | back, head, mouth, front |
13503
+ | `cow()` | animal | `walk` (to), `trot` (to), `moo`, `sit`, `lie`, `jump`, `nod`, `swish`, `graze` | `walk`, `walking`, `gait`, `neck`, `tail`, `wag`, `fl.swing`, `fl.knee`, `fl.ankle`, `fr.swing`, `fr.knee`, `fr.ankle`, `hl.swing`, `hl.knee`, `hl.ankle`, `hr.swing`, `hr.knee`, `hr.ankle` | back, head, mouth, front |
13504
+ | `songbird()` | bird | `hop` (to), `walk` (to), `peck`, `flap`, `tweet`, `fly` (to), `glide` (to), `land` | `spread`, `flap`, `wingbeat`, `flapping`, `peck`, `step`, `stepping`, `leg.left`, `leg.right` | beak, head, back, feet |
13505
+ | `crow()` | bird | `hop` (to), `walk` (to), `peck`, `flap`, `caw`, `fly` (to), `glide` (to), `land` | `spread`, `flap`, `wingbeat`, `flapping`, `peck`, `step`, `stepping`, `leg.left`, `leg.right` | beak, head, back, feet |
13003
13506
  | `chicken()` | bird | `hop` (to), `walk` (to), `peck`, `flap`, `cluck`, `flutter` | `spread`, `flap`, `wingbeat`, `flapping`, `peck`, `step`, `stepping`, `leg.left`, `leg.right` | beak, head, back, feet |
13004
13507
 
13005
13508
  ## Character (v2 human)
13006
13509
 
13007
- Poses: `rest`, `wave`, `cheer`, `point`, `handsOnHips`, `think`, `shrug`, `sit`, `kneel`, `crouch`, `crawl`, `lieDown`. Expressions: `neutral`, `happy`, `joyful`, `sad`, `crying`, `surprised`, `shocked`, `angry`, `furious`, `worried`, `scared`, `confused`, `skeptical`, `thinking`, `sleepy`, `disgusted`, `smug`, `wink`. Gags: `take`, `doubleTake`, `windUp`, `land`, `tremble`, `deflate`.
13510
+ Poses: `rest`, `wave`, `cheer`, `point`, `handsOnHips`, `think`, `shrug`, `sit`, `kneel`, `crouch`, `crawl`, `lieDown`, `sleep`, `stretch`, `sitFloor`, `carry`, `lift`, `push`, `pull`, `drink`, `phone`, `read`, `type`. Expressions: `neutral`, `happy`, `joyful`, `sad`, `crying`, `surprised`, `shocked`, `angry`, `furious`, `worried`, `scared`, `confused`, `skeptical`, `thinking`, `sleepy`, `disgusted`, `smug`, `wink`, `laughing`, `afraid`, `bored`, `tired`, `embarrassed`, `proud`, `determined`, `affectionate`, `hurt`, `suspicious`, `relieved`, `excited`. Gags: `take`, `doubleTake`, `windUp`, `land`, `tremble`, `deflate`.
13511
+
13512
+ Appearance options of `character({ … })`, all plain data that turns with the head (see docs/character-appearance.md):
13513
+
13514
+ - `build`: `standard`, `slim`, `tall`, `short`, `broad`, `curvy`, `stocky`, `kid`, `child`, `toddler`
13515
+ - `hair`: `bald`, `buzzCut`, `crewCut`, `short`, `sidePart`, `sideSwept`, `slickBack`, `quiff`, `spiky`, `undercut`, `curlyCrop`, `afro`, `wavyCrop`, `shortLocs`, `flatTop`, `receding`, `thinning`, `pixie`, `bob`, `longBob`, `wavyBob`, `shoulderStraight`, `shoulderWaves`, `longStraight`, `longWaves`, `longCurls`, `longLocs`, `lowPonytail`, `highPonytail`, `ponytail`, `sidePonytail`, `topBun`, `lowBun`, `singleBraid`, `twinBraids`, `braids` (colours: `black`, `brown`, `chestnut`, `auburn`, `blond`, `ginger`, `gray`, `white` in `HAIR_COLORS`)
13516
+ - `facialHair`: `cleanShaven`, `stubble`, `pencilMoustache`, `shortMoustache`, `chevron`, `handlebar`, `walrus`, `goatee`, `vanDyke`, `circleBeard`, `shortBoxed`, `fullBeard`, `longBeard`, `roundedBeard`, `pointedBeard`, `chinStrap`, `soulPatch`, `sideburns`, `muttonChops`, `moustacheStubble`
13517
+ - `glasses`: `round`, `square`, `sunglasses`; `hat`: `cap`, `beanie`, `hardHat`, `sunHat`, `bowler`; `ears: true`
13518
+ - `outfit`: `{ shirt, trousers, sleeves: short | long | none, bottom: trousers | shorts | skirt, collar, tie: colour, over: apron | labCoat, overColor }`
13519
+ - `castMember(name, height)`: `boy`, `girl`, `youngMan`, `youngWoman`, `man`, `woman`, `grandpa`, `grandma`, `doctor`, `cook`, `builder`, `courier`, `teacher`, `farmer`
13520
+ - Face marks (pose fields, 0–1): `blush`, `tears`, `sweat`
13521
+ - `holding`: `mug` (left or right), `phone` (left or right), `book` (one hand or both), `bag` (left or right), `briefcase` (left or right), `umbrella` (left or right), `broom` (left or right), `parcel` (both); pose fields `held.left`, `held.right`, `held.both` (below 0.5 lets go); `handGrip(joints, side)`
13522
+ - `meetHands(kind, a, b)` (stand them `meetingSpacing(kind, a, b)` apart): `handshake`, `highFive`, `fistBump`, `handOver`
13008
13523
 
13009
13524
  ## Code panel
13010
13525
 
@@ -13029,6 +13544,88 @@ Poses: `rest`, `wave`, `cheer`, `point`, `handsOnHips`, `think`, `shrug`, `sit`,
13029
13544
  - `drop(piece, n, column, { at, duration? })`: put a piece into a line (into its own line it slides, the text closing behind it)
13030
13545
  - `ride(tracks, figureId, { ground })`: a figure’s tracks with it carried by the line it stands on
13031
13546
 
13547
+ ## Surfaces
13548
+
13549
+ Scene objects figures act on. Places are named `kind:args`: `surface.anchor(name)` gives the box there (stand on `top`, point at `x`, `y`; pass it as a beat `target`), `surface.piece(name)` makes the part there come loose, and `surface.edit(name, anchor, options)` changes the surface at a time (`at`, ms).
13550
+
13551
+ Beats name places and say what surfaces do in answer (`surfaceScript`):
13552
+
13553
+ - `surfaceScript(figureId, { name: surface }, beats, options)`: compiles beats that act on surfaces: returns the script result with `tracks` (the figure’s, ridden, then every surface’s, keyed by its name) and `figureTracks`; options are scriptTracks’ plus `figureStyle` (for carry) and `ride` (default true)
13554
+ - `checkSurfaceBeats(beats, surfaces, cast?)`: every problem checkBeats finds, plus unknown surfaces, places, edits and moments, with suggestions
13555
+ - `{ surface, anchor }`: a named place, where a beat takes `target` (its box), `to` (its centre x) or `onto` (its top); as laid out, before any edit moves it
13556
+ - `then: { surface, edit, anchor, at?, until?, …options }`: what the surface does in answer to the beat (or a list of them): one of its edits, or `carry` (the piece follows the hand until `until`); the other fields are the edit’s options
13557
+ - `at`: a moment of the beat: start, contact, release, end (default contact, or start when the beat has none); not ms
13558
+ - `until`: a moment of this beat, or { beat: index, at? } of a later one; sets the edit’s duration (carry needs it)
13559
+
13560
+ ### code
13561
+
13562
+ `codePanel({ code, language?, x, y, fontSize?, lineHeight?, width?, hidden? })`
13563
+
13564
+ Anchors:
13565
+ - `box`: the whole panel
13566
+ - `line:N`: line N’s text (lines count from 1): stand on top, point at x, y, swipe left to right
13567
+ - `token:N:TEXT`: the first TEXT on line N (token:N#K:TEXT for the Kth): a word, which can come loose as a piece
13568
+ - `spot:N:C`: a place in line N before column C (0 is before its first character); spot:N:C:W is W characters wide. Aim a put or a write here
13569
+
13570
+ Edits:
13571
+ - `highlight`: line anchors; { at, duration?, on? }: tint lines (on: false clears)
13572
+ - `strike`: line anchors; { at, duration? }: strike lines through, left to right
13573
+ - `remove`: line anchors; { at, duration?, style?: wipe | fly | blur, from?: left | right, close? }: take lines away; the lines below close the gap
13574
+ - `type`: line anchors given in `hidden`; { at, duration? }: type them in
13575
+ - `insert`: a spot; { at, text, duration? }: type new text into the line there; the line makes room
13576
+ - `write`: a token; { at, text, duration? }: write new text into the word’s place
13577
+ - `drop`: a token; { at, into: a spot, duration? }: put the word into a line there
13578
+ - `move`: a token; { at, to: an anchor name or { x, y }, duration? }: move the word there
13579
+ - `fling`: a token; { at, velocity?, spin?, gravity?, duration? }: throw or kick the word away on a spinning arc
13580
+
13581
+ ### board
13582
+
13583
+ `whiteboard({ x, y, width, height, theme?: whiteboard | chalkboard, fontSize?, items: [{ id, text, at: [x, y], size?, color?, hidden? } | { id, mark: circle | box | underline | arrow, around? | from?, to?, color?, hidden? }] })`
13584
+
13585
+ Anchors:
13586
+ - `box`: the whole board
13587
+ - `text:ID`: a text item: write along it from left to right, point at it
13588
+ - `term:ID:TEXT`: the first TEXT in text ID (term:ID#K:TEXT for the Kth): a term, which can come loose as a piece
13589
+ - `mark:ID`: a mark (circle, box, underline or arrow)
13590
+
13591
+ Edits:
13592
+ - `write`: text anchors given `hidden`; { at, duration? }: write them in by hand. Or a term; { at, text, duration? }: write new text in its place (move or erase the term first)
13593
+ - `draw`: mark anchors given `hidden`; { at, duration? }: draw them in
13594
+ - `erase`: text, term or mark anchors; { at, duration? }: wipe them off
13595
+ - `strike`: text or term anchors; { at, duration? }: cross them out
13596
+ - `move`: a term; { at, to: an anchor name or { x, y }, duration? }: move the term there
13597
+ - `fling`: a term; { at, velocity?, spin?, gravity?, duration? }: throw or knock the term off on a spinning arc
13598
+
13599
+ ### chart
13600
+
13601
+ `chart({ x, y, width, height, kind: bar | line, data: [{ id, label?, value, hidden? }], max?, title?, theme?: light | dark, decimals?, prefix?, suffix?, values? })`
13602
+
13603
+ Anchors:
13604
+ - `box`: the whole chart
13605
+ - `bar:ID`: a bar (bar charts), as it stands at the time: stand on its top (it carries a figure as it grows), point at it
13606
+ - `point:ID`: a point on the line (line charts), as it stands at the time
13607
+ - `label:ID`: its label under the axis
13608
+ - `value:ID`: its value label, above it
13609
+
13610
+ Edits:
13611
+ - `set`: bar or point anchors; { at, value, duration? }: animate to a new value; its value label counts along
13612
+ - `show`: bar or point anchors given `hidden`; { at, duration?, on? }: grow a bar in from the axis, or draw the line out to a point (on: false takes it back)
13613
+ - `highlight`: bar or point anchors; { at, duration?, on? }: colour it out (on: false clears)
13614
+
13615
+ ### prop
13616
+
13617
+ `propSurface(propTarget({ x, y, prop }), { tracks? }): its controls and anchors are those the catalog lists for its preset`
13618
+
13619
+ Anchors:
13620
+ - `box`: the prop’s whole box
13621
+ - `anchor:NAME`: one of its rig’s anchors (door, seat, branch, ridge…), as posed at the time
13622
+ - `part:ID`: one of its parts as seen at the time (window-1, door-left, wheel-0-left…)
13623
+ - `control:NAME`: where the parts a control moves or lights are (control:door is the doors, control:lights the lamps)
13624
+
13625
+ Edits:
13626
+ - `set`: control anchors; { at, value, duration? }: move a control to a value
13627
+ - `switch`: control anchors; { at, on?, duration? }: a control to its full value (open, on), or back to its rest value with on: false
13628
+
13032
13629
  ## Camera shots (`cameraTracks(shots, { stage })`)
13033
13630
 
13034
13631
  - **frame**: `{ at, duration?, easing?, frame: { focus?: { x, y }, scale?, rotate? } }: push in, pull out, or cut (duration 0)`