@algorisys/tinyfly 0.121.0 → 0.123.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.
- package/README.md +22 -4
- package/docs/character-appearance.md +87 -1
- package/docs/editor-guide.md +1 -1
- package/docs/examples.md +12 -1
- package/docs/getting-started.md +1 -1
- package/docs/gsap-compat.md +1 -1
- package/docs/llm-guide.md +17 -0
- package/docs/maps.md +2 -2
- package/docs/math.md +1 -1
- package/docs/noir-detective.md +137 -0
- package/docs/teaching.md +1 -1
- package/lib/addons/characters.js +4250 -3747
- package/lib/addons/cricket-play-BVKhsPUD.js +5571 -0
- package/lib/addons/sports.js +1 -1
- package/lib/browser/tinyfly.iife.js +15 -13
- package/lib/browser/tinyfly.js +8603 -7764
- package/lib/browser/tinyfly.umd.js +15 -13
- package/lib/types/characters/body/bean-figure.d.ts +189 -0
- package/lib/types/characters/capabilities.d.ts +11 -0
- package/lib/types/characters/cast.d.ts +246 -2
- package/lib/types/characters/character.d.ts +21 -5
- package/lib/types/characters/head/face.d.ts +22 -2
- package/lib/types/characters/index.d.ts +3 -1
- package/lib/types/characters/noir/atmosphere.d.ts +124 -0
- package/lib/types/characters/noir/case-board.d.ts +137 -0
- package/lib/types/characters/noir/index.d.ts +12 -0
- package/lib/types/characters/noir/noir-kit.d.ts +38 -0
- package/lib/types/characters/noir/noir-utils.d.ts +31 -0
- package/lib/types/characters/noir/overlays.d.ts +178 -0
- package/llms-full.txt +299 -13
- package/llms.txt +32 -31
- package/package.json +1 -1
- package/skills/tinyfly/SKILL.md +12 -0
- package/lib/addons/cricket-play-C5CkNOc6.js +0 -5219
package/llms-full.txt
CHANGED
|
@@ -591,7 +591,7 @@ with a GSAP-style call (durations are in seconds here):
|
|
|
591
591
|
```html
|
|
592
592
|
<div class="box" style="width:60px;height:60px;background:#4a9eff"></div>
|
|
593
593
|
|
|
594
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
594
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.123.0/cdn/tinyfly.iife.js"></script>
|
|
595
595
|
<script>
|
|
596
596
|
tinyfly.to('.box', { x: 200, duration: 1 })
|
|
597
597
|
</script>
|
|
@@ -799,7 +799,7 @@ Without a build step, the all-in-one bundle exposes the same functions on a
|
|
|
799
799
|
global — `tinyfly.to()`, `tinyfly.timeline()` and so on:
|
|
800
800
|
|
|
801
801
|
```html
|
|
802
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
802
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.123.0/cdn/tinyfly.iife.js"></script>
|
|
803
803
|
<script>
|
|
804
804
|
tinyfly.to('.box', { x: 200, duration: 1 })
|
|
805
805
|
</script>
|
|
@@ -1982,6 +1982,17 @@ its own controls and scrolling in a full viewport; gallery panels and code
|
|
|
1982
1982
|
sections remain in the original tab. **Copy code** exports the same standalone
|
|
1983
1983
|
HTML. [Try the manga example](https://tinyfly.app/examples/live-manga-cast/full).
|
|
1984
1984
|
|
|
1985
|
+
## Noir Case File
|
|
1986
|
+
|
|
1987
|
+
[Noir Case File](https://tinyfly.app/examples/live-noir-case-file) plays a
|
|
1988
|
+
detective scene from the noir kit: rain on the window, street light through
|
|
1989
|
+
the blinds, a torch beam in the dark, the red clue magnifier, a speech
|
|
1990
|
+
bubble, a freeze-frame name card, a narration box and a time chip. Switch to
|
|
1991
|
+
the case board, where cards are pinned up, red string stretches between them
|
|
1992
|
+
and the marker crosses out, strikes, scribbles out and rings them. The bean
|
|
1993
|
+
cast wears a trench coat and a sari with a pallu and bangles. See
|
|
1994
|
+
[Noir and Detective Scenes](noir-detective.md).
|
|
1995
|
+
|
|
1985
1996
|
## Young Adult Manga Cast
|
|
1986
1997
|
|
|
1987
1998
|
[Young Adult Manga Cast](https://tinyfly.app/examples/live-manga-cast) shows
|
|
@@ -2714,7 +2725,7 @@ For simple website embedding without a build system.
|
|
|
2714
2725
|
</html>
|
|
2715
2726
|
```
|
|
2716
2727
|
|
|
2717
|
-
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.
|
|
2728
|
+
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.123.0/cdn/tinyfly-player.iife.js`.
|
|
2718
2729
|
|
|
2719
2730
|
---
|
|
2720
2731
|
|
|
@@ -7068,7 +7079,7 @@ The dialog shows the generated HTML/JavaScript code with a **Copy Code** button.
|
|
|
7068
7079
|
**Steps to embed:**
|
|
7069
7080
|
1. Build the player: `npm run build:player`
|
|
7070
7081
|
2. Copy `lib/player/tinyfly-player.iife.js` to your project (or load
|
|
7071
|
-
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
7082
|
+
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.123.0/cdn/tinyfly-player.iife.js`
|
|
7072
7083
|
instead; see [Deployment](DEPLOYMENT.md))
|
|
7073
7084
|
3. Copy the generated code into your HTML
|
|
7074
7085
|
4. Adjust the script `src` path if needed
|
|
@@ -8438,6 +8449,23 @@ from. The eight presets in `ANIME_CAST` (`animeBoy`, `animeGirl`,
|
|
|
8438
8449
|
Use `face: { style: 'anime', iris: '#4b7fce', lashes: true, ageLines: 0.6 }`
|
|
8439
8450
|
for coloured expressive eyes and optional creases; this is a face style,
|
|
8440
8451
|
not a `look` value. It uses the same expressions, blink, gaze and turn fields.
|
|
8452
|
+
White outlined stick figures are `figure: 'bean'` (presets `beanMan`, `beanWoman`,
|
|
8453
|
+
`beanKid`, `beanBoss`, `beanDetective`, `beanStick` in `BEAN_CAST`): seamless outlined noodle limbs or bare
|
|
8454
|
+
lines (`bean: { limbs: 'tube' | 'line' }`), a shaped body (`bean.torso` fullness), big oval eyes
|
|
8455
|
+
(`face.style: 'oval'`, usable on any figure), `hands: 'mitten'` and cartoon shoes; colours from
|
|
8456
|
+
`bean: { shirt, sleeves, trousers, shoes }` or an `outfit`; detective gear `bean: { coat, fedora, shades: true }`
|
|
8457
|
+
(aviators replace the eyes, brows still show); `halo` gives line limbs a pale edge. A bean is always drawn clean.
|
|
8458
|
+
Household clothes on a bean: `bean: { skirt: '#c2410c' }` (a sari to the ankle) or
|
|
8459
|
+
`skirt: { color, length: 0.45 }` (a kurta hem; pair it with `trousers`), `drape` (a pallu or dupatta sash)
|
|
8460
|
+
and `bangles`; preset `beanSari`. The skirt follows the legs (flared standing, along the thighs seated).
|
|
8461
|
+
For detective / noir scenes use the canvas kit (docs/noir-detective.md): `drawRain(ctx, time, box)`,
|
|
8462
|
+
`drawBlinds`, `drawDarkness(ctx, { amount, cones: [{ x, y, angle /* degrees */, length, width }], holes })`,
|
|
8463
|
+
`drawGlow`, `drawVignette`, `drawClueMarker(ctx, time, { x, y, at })`, `drawNameCard(ctx, time, { name, role, at, anchor })`,
|
|
8464
|
+
`drawNarrationBox(ctx, time, { text, start, end, speaker })`, `drawSpeechBubble(ctx, time, { text, start, end, tail })`,
|
|
8465
|
+
`drawTimeChip`, `drawClockFace`, `drawEvidenceFolder`, and a case board as data:
|
|
8466
|
+
`drawCaseBoard(ctx, caseBoard({ x, y, width, height, cards, strings, marks }), time, { drawCard })`
|
|
8467
|
+
(marks `cross | strike | scribble | circle`; it returns the marker nib). All times are ms and every
|
|
8468
|
+
function is a pure function of time; never use `Math.random` for rain or grain. Text is yours (any script).
|
|
8441
8469
|
The `look` values are `clean`, `pencil`, `silhouette` and `illustrated`
|
|
8442
8470
|
(inked and painted, tuned with `illustrated: { light, weight, taper, shadow, highlight }`).
|
|
8443
8471
|
Age is proportions, hair, creases and clothes, never a stoop; a `cane` in a hand or
|
|
@@ -8689,7 +8717,7 @@ path for all of that:
|
|
|
8689
8717
|
</figure>
|
|
8690
8718
|
|
|
8691
8719
|
<!-- once, anywhere on the page (a site-wide footer is fine) -->
|
|
8692
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
8720
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.123.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
|
|
8693
8721
|
```
|
|
8694
8722
|
|
|
8695
8723
|
Every `[data-tinyfly-embed]` mounts when the page is ready, with no per-post
|
|
@@ -9275,7 +9303,7 @@ lesson's step options (`duration`, `easing`, `delay`).
|
|
|
9275
9303
|
<figcaption>The determinant is the area of the unit square after the map.</figcaption>
|
|
9276
9304
|
</figure>
|
|
9277
9305
|
|
|
9278
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
9306
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.123.0/cdn/tinyfly-math.iife.js" data-tinyfly-auto></script>
|
|
9279
9307
|
```
|
|
9280
9308
|
|
|
9281
9309
|
The figure draws itself into an SVG and redraws from the timeline whenever the
|
|
@@ -10409,8 +10437,8 @@ On a page with no build step, load the maps add-on after the browser bundle; it
|
|
|
10409
10437
|
adds to the same `tinyfly` global:
|
|
10410
10438
|
|
|
10411
10439
|
```html
|
|
10412
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
10413
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
10440
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.123.0/cdn/tinyfly.iife.js"></script>
|
|
10441
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.123.0/cdn/tinyfly-maps.iife.js"></script>
|
|
10414
10442
|
```
|
|
10415
10443
|
|
|
10416
10444
|
It is a separate script because the offline world map it carries adds about
|
|
@@ -10613,6 +10641,148 @@ prop, or the depths to slot it between fingers.
|
|
|
10613
10641
|
|
|
10614
10642
|
---
|
|
10615
10643
|
|
|
10644
|
+
<!-- docs/noir-detective.md -->
|
|
10645
|
+
|
|
10646
|
+
# Noir and Detective Scenes
|
|
10647
|
+
|
|
10648
|
+
A kit for detective stories and film-noir moods on a canvas: rain on the
|
|
10649
|
+
window, street light through venetian blinds, a dark room with a torch beam,
|
|
10650
|
+
soft pools of light and a vignette; the red magnifier that marks a clue, an
|
|
10651
|
+
evidence folder, a wall clock and a time chip, a freeze-frame name card for a
|
|
10652
|
+
suspect, a first-person narration box and speech bubbles; and a case board
|
|
10653
|
+
with pinned cards, red string and the marker's cross-outs and scribble-outs.
|
|
10654
|
+
|
|
10655
|
+
Every function draws on a Canvas 2D context, takes the time in ms and plain
|
|
10656
|
+
options, and draws the same thing for the same input: rain comes from a
|
|
10657
|
+
seeded generator, never `Math.random`, so a frame looks the same whether it
|
|
10658
|
+
is rendered in order, out of order or scrubbed to. Text is always yours (any
|
|
10659
|
+
language or script) and so are the fonts (`font` is a CSS family list).
|
|
10660
|
+
|
|
10661
|
+
```js
|
|
10662
|
+
import { character, castMember, drawCharacter, humanPose, HUMAN_POSES,
|
|
10663
|
+
drawRain, drawBlinds, drawDarkness, drawVignette, drawClueMarker,
|
|
10664
|
+
drawNameCard, drawNarrationBox, drawTimeChip } from '@algorisys/tinyfly/characters'
|
|
10665
|
+
|
|
10666
|
+
const detective = character(castMember('beanDetective', 460))
|
|
10667
|
+
|
|
10668
|
+
function frame(ctx, time) {
|
|
10669
|
+
ctx.fillStyle = '#232b37'
|
|
10670
|
+
ctx.fillRect(0, 0, 1920, 1080)
|
|
10671
|
+
drawRain(ctx, time, { x: 1500, y: 160, width: 340, height: 440 }) // the window
|
|
10672
|
+
drawBlinds(ctx, { x: 0, y: 0, width: 1920, height: 1080, opacity: 0.08 })
|
|
10673
|
+
ctx.save(); ctx.translate(560, 880)
|
|
10674
|
+
drawCharacter(ctx, detective, humanPose({ ...HUMAN_POSES.think, turn: 0.45 }), time)
|
|
10675
|
+
ctx.restore()
|
|
10676
|
+
drawDarkness(ctx, { amount: 1, cones: [{ x: 640, y: 520, angle: 15, length: 760, width: 190 }] })
|
|
10677
|
+
drawClueMarker(ctx, time, { x: 900, y: 680, at: 1500 })
|
|
10678
|
+
drawNameCard(ctx, time, { name: 'The witness', role: 'heard footsteps', at: 6800, anchor: { x: 1340, y: 470 } })
|
|
10679
|
+
drawVignette(ctx, { width: 1920, height: 1080 })
|
|
10680
|
+
drawTimeChip(ctx, time, { x: 50, y: 40, text: 'Tuesday · 9:40 PM' })
|
|
10681
|
+
drawNarrationBox(ctx, time, { text: 'It rained all night.', start: 300, end: 3400, speaker: 'Case file #1' })
|
|
10682
|
+
}
|
|
10683
|
+
```
|
|
10684
|
+
|
|
10685
|
+
The [Noir Case File](https://tinyfly.app/examples/live-noir-case-file)
|
|
10686
|
+
example plays a whole scene and its case board.
|
|
10687
|
+
|
|
10688
|
+
## Atmosphere
|
|
10689
|
+
|
|
10690
|
+
| Function | What it draws |
|
|
10691
|
+
|---|---|
|
|
10692
|
+
| `drawRain(ctx, time, { x, y, width, height, drops?, opacity?, color?, speed?, length?, slant?, lineWidth?, seed? })` | Streaks falling in a box (a window, or the whole frame), clipped to it. 70 drops at 900–1440 px/s by default; `seed` moves them. |
|
|
10693
|
+
| `drawBlinds(ctx, { x, y, width, height, opacity?, slope?, spacing?, band?, color? })` | Key light through venetian blinds: parallel slanted bands (`slope` 0.35, every 52 px, 24 px thick). |
|
|
10694
|
+
| `drawDarkness(ctx, { amount, cones?, holes?, bounds?, color?, opacity?, beam?, beamOpacity? })` | A dark overlay (`amount` 0–1) with torch beams and round holes cut out. A cone is `{ x, y, angle, length, width }`: from its apex toward `angle` degrees (0 right, 90 down), `width` half-wide at its end; a hole is `{ x, y, radius }`. Beams keep a little of the dark and a faint warm tint (`beam: null` for none). `coneCorners(cone)` gives a beam's corners. |
|
|
10695
|
+
| `drawGlow(ctx, { x, y, radius, color?, opacity? })` | A soft pool of light (a lamp, a lit window): a radial gradient to clear. |
|
|
10696
|
+
| `drawVignette(ctx, { width, height, x?, y?, inner?, outer?, opacity?, color? })` | The frame's edges fall into dark, from `inner` to `outer` of the half-diagonal. |
|
|
10697
|
+
| `lightningFlash(time, strikes, decay?)` | Flash brightness 0–1 from strike times; fill the frame with a pale blue at about 0.25 × this. |
|
|
10698
|
+
| `lightFlicker(time, strength?)` | A failing bulb: 0 or `strength`, in an irregular but repeatable rhythm; darken the room by it. |
|
|
10699
|
+
|
|
10700
|
+
Colours may be `#rgb`, `#rrggbb`, `rgb()` or `rgba()`; opacities multiply in.
|
|
10701
|
+
|
|
10702
|
+
## Detective overlays
|
|
10703
|
+
|
|
10704
|
+
| Function | What it draws |
|
|
10705
|
+
|---|---|
|
|
10706
|
+
| `drawClueMarker(ctx, time, { x, y, radius?, at, duration?, color?, lineWidth? })` | The red magnifier over a clue (or a red herring): pops on at `at`, pulses, fades out over the last 400 ms of `duration` (3000). Returns its opacity; `clueMarkerAt(time, { at, duration })` gives `{ opacity, scale }`. |
|
|
10707
|
+
| `drawEvidenceFolder(ctx, { x, y, scale?, angle?, color?, ink?, label?, font? })` | A tabbed folder (68 × 48 px at scale 1), tilted `angle` degrees, with an optional short label. |
|
|
10708
|
+
| `drawClockFace(ctx, { x, y, radius?, hours, minutes, face?, ink? })` | A wall clock showing a time; `clockHandAngles(hours, minutes)` gives the hands. |
|
|
10709
|
+
| `drawTimeChip(ctx, time, { x, y, text, size?, font?, color?, background?, at? })` | A time or place chip (amber on black) that fades in; returns its width. |
|
|
10710
|
+
| `drawNameCard(ctx, time, { name, role?, at, duration?, anchor, side?, frame?, dim?, color?, nameSize?, roleSize?, font?, tilt? })` | The freeze-frame suspect card: the frame dims (`dim` 0.35) and a slanted red band names them beside their head (`anchor`), on the side with room (`side: 'auto'`). Returns its opacity. |
|
|
10711
|
+
| `drawNarrationBox(ctx, time, { text, start, end, speaker?, x?, width?, bottom?, size?, font?, background?, ink?, tagColor?, typeDuration? })` | A first-person narration box along the bottom: cream paper, the narrator's tag, the words typed on a whole word at a time (so every script types cleanly). `lineReveal(time, start, end)` gives `{ opacity, reveal }`. |
|
|
10712
|
+
| `drawSpeechBubble(ctx, time, { text, start, end, tail, speaker?, maxWidth?, size?, font?, bounds?, maxCenterY?, gap?, fill?, ink? })` | A crisp comic bubble above the speaker, its tail to `tail` (their head), kept inside `bounds`; pops on at `start`, shrinks away after `end`. |
|
|
10713
|
+
|
|
10714
|
+
The defaults fit a 1920 × 1080 frame; pass `frame`, `bounds` or `x`/`width`
|
|
10715
|
+
for another size. Draw overlays after the camera's transform is undone (in
|
|
10716
|
+
screen space) and map heads with your camera, as `cameraPoint` does.
|
|
10717
|
+
|
|
10718
|
+
## The case board
|
|
10719
|
+
|
|
10720
|
+
A board is plain data: cards (photos of suspects, notes about clues), strings
|
|
10721
|
+
between them and the marker's work, each with a time.
|
|
10722
|
+
|
|
10723
|
+
```js
|
|
10724
|
+
import { caseBoard, drawCaseBoard, caseBoardMarkerTip, drawCharacter, humanPose } from '@algorisys/tinyfly/characters'
|
|
10725
|
+
|
|
10726
|
+
const board = caseBoard({
|
|
10727
|
+
x: 60, y: 110, width: 1800, height: 900,
|
|
10728
|
+
cards: [
|
|
10729
|
+
{ id: 'title', x: 900, y: 40, kind: 'note', title: 'WHO CUT THE ALARM?', width: 520, height: 96 },
|
|
10730
|
+
{ id: 'lift', x: 900, y: 300, title: 'Lift 2', note: 'stuck at 9:40' },
|
|
10731
|
+
{ id: 'guard', x: 330, y: 540, title: 'The guard', note: 'had the key', at: 700 },
|
|
10732
|
+
{ id: 'wire', x: 1450, y: 220, kind: 'note', title: 'alarm wire: cut', at: 1400 },
|
|
10733
|
+
],
|
|
10734
|
+
strings: [{ from: 'lift', to: 'guard', at: 1000 }, { from: 'lift', to: 'wire', at: 1400 }],
|
|
10735
|
+
marks: [
|
|
10736
|
+
{ on: 'guard', kind: 'cross', at: 3200 },
|
|
10737
|
+
{ on: 'title', kind: 'scribble', at: 6000, duration: 1200 },
|
|
10738
|
+
],
|
|
10739
|
+
})
|
|
10740
|
+
|
|
10741
|
+
const nib = drawCaseBoard(ctx, board, time, {
|
|
10742
|
+
drawCard: (ctx, card, area) => { /* draw a portrait inside area (clipped), in the card's frame */ },
|
|
10743
|
+
})
|
|
10744
|
+
if (nib) drawMarkerHand(ctx, nib) // your own hand or pen, at the marker's nib
|
|
10745
|
+
```
|
|
10746
|
+
|
|
10747
|
+
- **Cards**: `{ id, x, y, kind?, title?, note?, width?, height?, angle?, color?, at?, highlight? }`.
|
|
10748
|
+
`x`, `y` is where the card is pinned (its top centre), relative to the
|
|
10749
|
+
board. `kind: 'photo'` (default, 220 × 260) is a print with a dark picture
|
|
10750
|
+
area, a bold title and a red note; `kind: 'note'` (220 × 124) is a yellow
|
|
10751
|
+
slip with the title and note in `handFont`. A card pops up onto its pin at
|
|
10752
|
+
`at`; `highlight: { at, duration }` pulses an amber outline round it. Tilts
|
|
10753
|
+
default to a small seeded angle.
|
|
10754
|
+
- **Strings**: `{ from, to, at?, duration?, color? }`, red string stretching
|
|
10755
|
+
from one pin to the other over `duration` (600 ms), under the cards.
|
|
10756
|
+
- **Marks**: `{ on, kind, at, duration?, color?, width? }`, the marker drawn
|
|
10757
|
+
on over `duration` (1400 ms): `cross` (two diagonals, one after the
|
|
10758
|
+
other: ruled out), `strike` (one diagonal: half ruled out), `scribble` (a
|
|
10759
|
+
zigzag across the card: scribbled out) and `circle` (a loose ring round
|
|
10760
|
+
it). Marks stay once drawn.
|
|
10761
|
+
- `caseBoard` checks the board and resolves every default; an unknown card
|
|
10762
|
+
id or kind throws with a did-you-mean.
|
|
10763
|
+
- `drawCaseBoard(ctx, board, time, { drawCard })` returns the marker's nib
|
|
10764
|
+
while a mark is being drawn (else null), as does
|
|
10765
|
+
`caseBoardMarkerTip(board, time)`: put a hand there. `caseCardBox(board, id)`
|
|
10766
|
+
gives a card's pin, centre and corners; `caseMarkPath(board, mark)` a
|
|
10767
|
+
mark's stroke points; `drawPushPin` and `drawMarkerStroke(ctx, points,
|
|
10768
|
+
progress)` draw single pieces for your own boards.
|
|
10769
|
+
|
|
10770
|
+
## With the characters
|
|
10771
|
+
|
|
10772
|
+
The [bean figures](character-appearance.md#bean-figures-white-outlined-stick-figures)
|
|
10773
|
+
come dressed for it: `castMember('beanDetective')` wears a trench coat, a
|
|
10774
|
+
fedora and aviator shades, and household clothes (`skirt`, `drape`,
|
|
10775
|
+
`bangles`; `castMember('beanSari')`) dress the witnesses. Draw a suspect in a
|
|
10776
|
+
photo card through `drawCard`, and anchor a name card or a speech bubble at a
|
|
10777
|
+
figure's head from `characterJoints`.
|
|
10778
|
+
|
|
10779
|
+
## In the catalog
|
|
10780
|
+
|
|
10781
|
+
`npx tinyfly capabilities` lists the kit under "Noir / detective kit";
|
|
10782
|
+
`capabilities().noir` has it as data (`NOIR_KIT`).
|
|
10783
|
+
|
|
10784
|
+
---
|
|
10785
|
+
|
|
10616
10786
|
<!-- docs/character-appearance.md -->
|
|
10617
10787
|
|
|
10618
10788
|
# Character Appearance
|
|
@@ -11114,7 +11284,7 @@ cast member at an adult `height` (each stands at their own scale of it). The
|
|
|
11114
11284
|
family: `boy`, `girl`, `youngMan`, `youngWoman`, `man`, `woman`, `grandpa`,
|
|
11115
11285
|
`grandma`; at work (from the occupations sheet): `doctor`, `cook`, `builder`,
|
|
11116
11286
|
`courier`, `teacher`, `farmer`. `CHARACTER_CAST` has each one's `label`,
|
|
11117
|
-
`group` (`family`, `work`, `anime` or `
|
|
11287
|
+
`group` (`family`, `work`, `anime`, `manga` or `bean`), `scale` and `options`.
|
|
11118
11288
|
|
|
11119
11289
|
```js
|
|
11120
11290
|
const family = ['man', 'woman', 'girl', 'grandma'].map((name) => character(castMember(name, 280)))
|
|
@@ -11157,6 +11327,92 @@ face close-ups and a complete turnaround. Both the Character and 3D Scene
|
|
|
11157
11327
|
editors offer these presets in their Cast picker. The Character editor also
|
|
11158
11328
|
has Face style, Iris colour, Eyelashes and Age creases controls, saved in project JSON.
|
|
11159
11329
|
|
|
11330
|
+
### Bean figures (white outlined stick figures)
|
|
11331
|
+
|
|
11332
|
+
`figure: 'bean'` draws the common white outlined stick-figure style: a white
|
|
11333
|
+
figure with a thick black outline, smooth noodle limbs, a shaped body (rounded
|
|
11334
|
+
shoulders, a slight waist, fuller hips and a rounded seat), a round head with
|
|
11335
|
+
big white oval eyes, small pupils and heavy brows, white mittens and big
|
|
11336
|
+
cartoon shoes (a flat sole on the ground, a rounded toe cap, a low heel). The
|
|
11337
|
+
rig solves the pose as for every figure, so every pose, gait, dance, reach,
|
|
11338
|
+
turn and lip-sync works on it.
|
|
11339
|
+
|
|
11340
|
+
```js
|
|
11341
|
+
const hero = character({ figure: 'bean', height: 400, hair: { style: 'spiky', color: '#111' },
|
|
11342
|
+
bean: { shirt: '#ef4444', trousers: '#1e3a5f' } })
|
|
11343
|
+
drawCharacter(ctx, hero, humanPose({ ...HUMAN_POSES.point, ...HUMAN_EXPRESSIONS.happy, turn: 0.5 }))
|
|
11344
|
+
const stick = character(castMember('beanStick', 400)) // bare line limbs
|
|
11345
|
+
```
|
|
11346
|
+
|
|
11347
|
+
- Each limb is one smooth curve through its joints, stroked in the ink and
|
|
11348
|
+
stroked again, narrower, in the fill, with round caps and joins: elbows and
|
|
11349
|
+
knees never show a seam. The front arm, and on a plain figure the neck and
|
|
11350
|
+
the legs, join the body without a seam: their outline is left out where it
|
|
11351
|
+
lies inside the body at the root, so the fills flow together. Under a tee or
|
|
11352
|
+
trousers the hem shows instead.
|
|
11353
|
+
- Painter order (`joints.parts[id].order`): the back arm, the legs (and a
|
|
11354
|
+
skirt over both), the neck, the body (with its drape, and coat), the near
|
|
11355
|
+
arm and the head (and fedora). A limb reaching toward the viewer
|
|
11356
|
+
(hands on the knees, seated thighs) draws over the body.
|
|
11357
|
+
- `bean: { limbs, torso, limbWidth, lineWidth, outlineWidth, fill, shirt, sleeves, trousers, shoes }`:
|
|
11358
|
+
`limbs: 'tube'` (default, outlined noodles) or `'line'` (bare round-capped
|
|
11359
|
+
ink lines for the arms, legs and neck; the body, eyes, mittens and shoes
|
|
11360
|
+
stay; `halo: '#f5f5f4'` adds a pale edge so they read on a dark set); the
|
|
11361
|
+
near arm is in front of the body in both modes; `torso` body fullness
|
|
11362
|
+
(1; 1.3 chubby, 0.85 thin); widths as fractions of the height (0.024 tube,
|
|
11363
|
+
0.017 line, 0.0105 outline; `lineWidth` on the character also sets the
|
|
11364
|
+
outline); `fill` (white); a `shirt` colour with `sleeves: 'short' | 'long' | 'none'`;
|
|
11365
|
+
`trousers`; `shoes` (the fill; a dark shoe gets a shine and a dark sole).
|
|
11366
|
+
An `outfit`'s `shirt`, `trousers` and `sleeves` colour the bean too (its
|
|
11367
|
+
layers are not used).
|
|
11368
|
+
- Detective gear: `coat` (a trench coat in that colour: lapels, a belt and
|
|
11369
|
+
buckle, double-breasted buttons, a hem at the knee and sleeves to the
|
|
11370
|
+
wrist), `fedora` (a brim, a pinched crown and a band) and `shades: true`
|
|
11371
|
+
(big dark aviator lenses in place of the eyes, the brows still showing,
|
|
11372
|
+
so the face keeps its expression; the same as `face: { shades: true }` on
|
|
11373
|
+
any oval-eyed face). `castMember('beanDetective', 400)` wears all three.
|
|
11374
|
+
- Household clothes (all off by default):
|
|
11375
|
+
- `skirt`: a colour (a sari or long skirt, ending just above the ankle so
|
|
11376
|
+
the shoes show) or `{ color, length }`, `length` 0.1–1 of the way from
|
|
11377
|
+
the hips to the ankles (about 0.45 for a kurta's hem over trousers). It
|
|
11378
|
+
follows the legs: standing or walking it is one flared shape outside both
|
|
11379
|
+
legs with two soft pleats; seated (`beanStanding(joints)` is false) it
|
|
11380
|
+
lies along each thigh to the knees and shins, its ends kept above the
|
|
11381
|
+
floor. Under a skirt the legs draw before the body, so the body covers
|
|
11382
|
+
the waist.
|
|
11383
|
+
- `drape`: a pallu or dupatta in that colour, a band from the shoulder by
|
|
11384
|
+
the neck across the chest to the far hip, inside the body's outline.
|
|
11385
|
+
- `bangles`: their colour; three thin rings across each forearm near the
|
|
11386
|
+
wrist (`BEAN_BANGLE_STOPS`), over any sleeve.
|
|
11387
|
+
- `castMember('beanSari', 400)` wears all three, with a blouse (`shirt`),
|
|
11388
|
+
a low bun and dark shoes.
|
|
11389
|
+
|
|
11390
|
+
```js
|
|
11391
|
+
const kurta = character({ figure: 'bean', height: 400, hair: { style: 'bob', color: '#222' },
|
|
11392
|
+
bean: { shirt: '#0e7490', skirt: { color: '#0e7490', length: 0.45 }, trousers: '#f5f5f4', drape: '#fbbf24', bangles: '#dc2626' } })
|
|
11393
|
+
```
|
|
11394
|
+
- Defaults: ink `#111111`, white skin, `hands: 'mitten'`, shoulders 0.04 and
|
|
11395
|
+
hips 0.02 of the height, `face: { style: 'oval', projection: 'volume', teeth: true, tongue: true }`.
|
|
11396
|
+
The bean is always drawn in the clean look (its outline is the look).
|
|
11397
|
+
- `face.style: 'oval'` works on any figure: big white oval eyes almost
|
|
11398
|
+
touching, a small pupil following `lookX`/`lookY`, lids in the skin for
|
|
11399
|
+
`lid`, a blink or a half-open `eye.*`, a lid line when shut (arched up in a
|
|
11400
|
+
laugh), heavy brows for `brow.left`/`brow.right` and `browTilt`, and
|
|
11401
|
+
bigger eyes for `eye.*` above 1 and `bulge`. Glasses grow to fit round the
|
|
11402
|
+
big eyes; `face.shades` puts aviators in their place.
|
|
11403
|
+
- `hands: 'mitten'` (any figure) is a plain oval mitten along the forearm.
|
|
11404
|
+
- Presets in `BEAN_CAST` (also in `CHARACTER_CAST`, group `bean`):
|
|
11405
|
+
`beanMan`, `beanWoman`, `beanKid`, `beanBoss`, `beanDetective`,
|
|
11406
|
+
`beanStick` (bare lines) and `beanSari` (a sari with a pallu and bangles).
|
|
11407
|
+
- Helpers for your own layers: `beanTorso(bean, joints)` and
|
|
11408
|
+
`beanTorsoOutline(torso)` (the body's shape), `beanLimbLine(root, joint, end)`
|
|
11409
|
+
(a limb's centre line), `mittenAt`, `beanShoeAt`, `beanOrder`, `beanOverBody`,
|
|
11410
|
+
`drawBeanFedora`, `beanAlongLeg(joints, side, f)` (a point along a leg) and
|
|
11411
|
+
`beanStanding(joints)`.
|
|
11412
|
+
- For detective and noir scenes around these figures (rain, blinds, torch
|
|
11413
|
+
beams, clue markers, name cards, a case board), see
|
|
11414
|
+
[Noir and Detective Scenes](noir-detective.md).
|
|
11415
|
+
|
|
11160
11416
|
### Young adult manga cast
|
|
11161
11417
|
|
|
11162
11418
|
`MANGA_CAST` supplies four original archetypes: `mangaYoungMan`,
|
|
@@ -15639,7 +15895,7 @@ magnet.addEventListener('pointerleave', () => {
|
|
|
15639
15895
|
|
|
15640
15896
|
<!-- capabilities: generated from the library -->
|
|
15641
15897
|
|
|
15642
|
-
# tinyfly capabilities (v0.
|
|
15898
|
+
# tinyfly capabilities (v0.123.0)
|
|
15643
15899
|
|
|
15644
15900
|
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).
|
|
15645
15901
|
|
|
@@ -15923,7 +16179,7 @@ Native dances: `garba`, `garbaThreeClap`, `dandiya`; `humanDanceFrame(style, bea
|
|
|
15923
16179
|
Appearance options of `character({ … })`, all plain data that turns with the head (see docs/character-appearance.md):
|
|
15924
16180
|
|
|
15925
16181
|
- `build`: `standard`, `slim`, `tall`, `short`, `broad`, `curvy`, `stocky`, `kid`, `child`, `toddler`
|
|
15926
|
-
- `figure`: `fluid`, `stick`, `organic`
|
|
16182
|
+
- `figure`: `fluid`, `stick`, `organic`, `bean`
|
|
15927
16183
|
- `look`: `clean` (default), `pencil`, `silhouette`, `illustrated` (inked and painted: line weight follows the light, brush-tapered strokes, shadow/core/highlight tones from each fill; `illustrated: { light: [x, y], weight, taper, shadow, highlight }`, each 0–1)
|
|
15928
16184
|
- `body.torso · body.arm · body.leg · body.neck`: Organic half-width profiles: [{ at: 0..1, width: fractionOfHeight }], increasing from 0 to 1; independent of ink width.
|
|
15929
16185
|
- `body.measurements`: Organic torso from tape-measure girths { height, bust, underbust?, waist, hip } in any one unit, or a named shape (hourglass | pear | rectangle | invertedTriangle | round). Sets the front width, the side depth (bust forward, seat back, belly) and the hip and thigh spacing; reads correctly at every turn. An explicit torso / torsoFront / torsoBack / hipWidth still wins.
|
|
@@ -15932,21 +16188,51 @@ Appearance options of `character({ … })`, all plain data that turns with the h
|
|
|
15932
16188
|
- `softCartoonCharacter(name, options?)`: Original youngMan / youngWoman / childBoy / childGirl story presets. Children have larger head proportions, shorter limbs and rounded torsos; every face, hair, build, hand, clothing and material option can be overridden.
|
|
15933
16189
|
- `face.projection`: Organic default volume follows the head axes, keeps both eyes in three-quarter views and projects a small nose above the mouth; opaque hair covers features. cartoon keeps the classic face slide.
|
|
15934
16190
|
- `outfitPreset(category, overrides?)`: Fresh JSON Everyday / Formal / Casual wardrobe defaults for every actor; top: tshirt | shirt | blouse | dress, trouserStyle: plain | jeans | cargo, colours, sleeves, bottoms, collar and tie are editable.
|
|
16191
|
+
- `figure: 'bean'`: The white outlined stick figure: one smooth stroked outline per limb (no seams at elbows, knees or the front arm's shoulder), a shaped body (rounded shoulders, slight waist, fuller hips), big oval eyes, mittens and cartoon shoes; every pose, gait, dance and turn works. Always drawn clean; the near arm is in front of the body in both limb modes. `bean: { limbs: tube | line, halo (a pale edge on line limbs), torso, limbWidth, lineWidth, outlineWidth, fill, shirt, sleeves: short | long | none, trousers, shoes (a dark shoe gets a shine), coat (a trench coat: lapels, belt and buckle, buttons, knee hem, sleeves to the wrist), fedora, shades (aviators in place of the eyes; brows still show) }`; an `outfit`'s shirt, trousers and sleeves colour it. `castMember('beanMan' | 'beanWoman' | 'beanKid' | 'beanBoss' | 'beanDetective' | 'beanStick', h)`.
|
|
16192
|
+
- `hands`: `dot` | `cartoon` (with `handStyle: glove | natural`) | `mitten` (a plain oval mitten; the bean figure's default)
|
|
15935
16193
|
- `leafOutfit`: Organic-only JSON garment { top?, color?, accent?, length? }; curved leaves follow torso/thighs at native part depths. Everyday basicOutfit also follows organic contours.
|
|
15936
16194
|
- `hair`: `softSweep`, `flowingBob`, `cascadingWaves`, `bald`, `buzzCut`, `crewCut`, `short`, `sidePart`, `sideSwept`, `slickBack`, `quiff`, `spiky`, `mangaSpikes`, `mangaSweep`, `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`)
|
|
15937
16195
|
- Flowing hair: `softSweep`, `flowingBob`, `cascadingWaves`; editable `locks: [{ path, width, follow? }]` with cubic `{ around, up, lift? }` points (around in degrees, dimensions in head radii), `fall: { taper, wave }` and `shine` (0–1). Roots stay attached; `hairFollowTracks` also drives flexible short locks.
|
|
15938
16196
|
- `facialHair`: `cleanShaven`, `stubble`, `pencilMoustache`, `shortMoustache`, `chevron`, `handlebar`, `walrus`, `goatee`, `vanDyke`, `circleBeard`, `shortBoxed`, `fullBeard`, `longBeard`, `roundedBeard`, `pointedBeard`, `chinStrap`, `soulPatch`, `sideburns`, `muttonChops`, `moustacheStubble`
|
|
15939
16197
|
- `glasses`: `round`, `square`, `sunglasses`; `hat`: `cap`, `beanie`, `hardHat`, `sunHat`, `bowler`; `ears: true`; `face: { teeth, tongue }` (shown when the mouth opens); `feet`: `round`, `flat`, `pointed`, `big`
|
|
15940
16198
|
- `outfit`: `{ top: tshirt | shirt | blouse | dress, trouserStyle: plain | jeans | cargo, shirt: top colour, trousers: bottom colour, sleeves: short | long | none, bottom: trousers | shorts | skirt, collar, tie: colour, over: apron | labCoat | hoodie | cardigan | overalls | sari, overColor, shoes: boots, shoeColor }`
|
|
15941
|
-
- `castMember(name, height)`: `boy`, `girl`, `youngMan`, `youngWoman`, `man`, `woman`, `grandpa`, `grandma`, `doctor`, `cook`, `builder`, `courier`, `teacher`, `farmer`, `animeBoy`, `animeGirl`, `animeYoungMan`, `animeYoungWoman`, `animeMan`, `animeWoman`, `animeOlderMan`, `animeOlderWoman`, `mangaYoungMan`, `mangaYoungWoman`, `mangaRival`, `mangaHeroine`
|
|
16199
|
+
- `castMember(name, height)`: `boy`, `girl`, `youngMan`, `youngWoman`, `man`, `woman`, `grandpa`, `grandma`, `doctor`, `cook`, `builder`, `courier`, `teacher`, `farmer`, `animeBoy`, `animeGirl`, `animeYoungMan`, `animeYoungWoman`, `animeMan`, `animeWoman`, `animeOlderMan`, `animeOlderWoman`, `mangaYoungMan`, `mangaYoungWoman`, `mangaRival`, `mangaHeroine`, `beanMan`, `beanWoman`, `beanKid`, `beanBoss`, `beanDetective`, `beanStick`, `beanSari`
|
|
15942
16200
|
- Face marks (pose fields, 0–1): `blush`, `tears`, `sweat`; close-up fields `pupil` (size, 1 usual), `lid` (upper lids lowered, 0–1), `bulge` (eyes out of the head, 0–1); `face: { nose: true, inPupil(ctx, pupil) }`; `drawCharacterHead(ctx, who, pose, { x, y, radius })` draws just the head big
|
|
15943
|
-
- Face styles: `simple`, `anime`; `face: { style: 'anime', iris: '#4b7fce', lashes: true, ageLines: 0.8 }` uses coloured eyes and the same expressions, blinks and gaze. `ANIME_CAST` contains eight age presets, also available through `castMember`.
|
|
16201
|
+
- Face styles: `simple`, `anime`, `oval`; `face: { style: 'anime', iris: '#4b7fce', lashes: true, ageLines: 0.8 }` uses coloured eyes and the same expressions, blinks and gaze. `ANIME_CAST` contains eight age presets, also available through `castMember`. `face: { style: 'oval' }` (the bean figure's default) draws big white oval eyes with small pupils that follow `lookX`/`lookY`, lids for `lid`, `blink` and half-open eyes, and heavy brows for `brow.*`/`browTilt`; glasses grow to fit round them.
|
|
15944
16202
|
- Face shapes: `round`, `angular`; `face: { shape: 'angular', jawWidth: 0.74, chinWidth: 0.14, eyeScale: 0.8, eyeAspect: 0.65 }` sets a tapered 3D jaw and narrower anime eyes; `jawRoundness: 1` softens the cheek/chin corners (default 0 keeps sharp jaws). `MANGA_CAST` contains four original young adult presets; hair styles `mangaSpikes` and `mangaSweep` remain editable.
|
|
15945
16203
|
- Hair in motion (pose fields): `hair.swing` (degrees round the head, + toward its left), `hair.trail` (head radii back), `hair.lift` (head radii up); key them with `hairFollowTracks(target, tracks, who)` after the character's tracks, or `hairFollow` + `hairMotionAt` when posing per frame
|
|
15946
16204
|
- `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), `cane` (left or right), `parcel` (both); pose fields `held.left`, `held.right`, `held.both` (below 0.5 lets go); `handGrip(joints, side)`
|
|
15947
16205
|
- `meetHands(kind, a, b)` (stand them `meetingSpacing(kind, a, b)` apart): `handshake`, `highFive`, `fistBump`, `handOver`; `embrace(a, b)` (a hug, `embraceSpacing` apart); `helpUp(helper, sitter, progress)` (0 on the floor, hand taken; 1 standing; `helpUpSpacing` apart)
|
|
15948
16206
|
- Everyday cycles like a gait: `humanCyclePose('sweeping' | 'brushing', phase, base)` (0 → 1 is one stroke and back; sweeping with `holding: { right: 'broom' }`)
|
|
15949
16207
|
|
|
16208
|
+
## Noir / detective kit
|
|
16209
|
+
|
|
16210
|
+
Canvas drawing functions for detective and noir scenes (see docs/noir-detective.md). Times are ms; every one is a pure function of its options and the time (rain is seeded), so frames draw the same in any order. Text and fonts are the caller’s.
|
|
16211
|
+
|
|
16212
|
+
- `drawRain(ctx, time, { x, y, width, height, drops?, opacity?, color?, speed?, length?, slant?, lineWidth?, seed? })`: rain streaks falling in a box (a window, the frame), clipped to it; seeded, a pure function of time
|
|
16213
|
+
- `drawBlinds(ctx, { x, y, width, height, opacity?, slope?, spacing?, band?, color? })`: key light through venetian blinds: slanted bright bands
|
|
16214
|
+
- `drawDarkness(ctx, { amount, cones?: [{ x, y, angle (deg), length, width }], holes?: [{ x, y, radius }], bounds?, color?, opacity?, beam?, beamOpacity? })`: a dark room with torch beams and round holes of light cut out (coneCorners(cone) gives a beam’s corners)
|
|
16215
|
+
- `drawGlow(ctx, { x, y, radius, color?, opacity? })`: a soft pool of light
|
|
16216
|
+
- `drawVignette(ctx, { width, height, x?, y?, inner?, outer?, opacity?, color? })`: the frame’s edges fall into dark
|
|
16217
|
+
- `lightningFlash(time, strikes, decay?)`: flash brightness 0..1 from strike times (ms)
|
|
16218
|
+
- `lightFlicker(time, strength?)`: a failing bulb: how much darker the room is (0 or strength)
|
|
16219
|
+
- `drawClueMarker(ctx, time, { x, y, radius?, at, duration?, color?, lineWidth? })`: the red magnifier over a clue: pops on, pulses, fades (clueMarkerAt gives its opacity and scale)
|
|
16220
|
+
- `drawEvidenceFolder(ctx, { x, y, scale?, angle?, color?, ink?, label?, font? })`: a tabbed evidence folder
|
|
16221
|
+
- `drawClockFace(ctx, { x, y, radius?, hours, minutes, face?, ink? })`: a wall clock showing a time (clockHandAngles gives the hands)
|
|
16222
|
+
- `drawTimeChip(ctx, time, { x, y, text, size?, font?, color?, background?, at? })`: a time/place chip in a corner; returns its width
|
|
16223
|
+
- `drawNameCard(ctx, time, { name, role?, at, duration?, anchor, side?, frame?, dim?, color?, font?, tilt? })`: a freeze-frame suspect card: the frame dims, a slanted red band beside the head
|
|
16224
|
+
- `drawNarrationBox(ctx, time, { text, start, end, speaker?, x?, width?, bottom?, size?, font?, typeDuration? })`: a first-person narration box along the bottom, words typed on (lineReveal gives opacity and reveal)
|
|
16225
|
+
- `drawSpeechBubble(ctx, time, { text, start, end, tail, speaker?, maxWidth?, size?, font?, bounds?, maxCenterY?, gap? })`: a comic speech bubble above the speaker, tail to the head, popping on
|
|
16226
|
+
- `caseBoard({ x, y, width, height, cards, strings?, marks?, cork?, frame?, font?, handFont?, seed? })`: checks and resolves a case board (did-you-mean on unknown card ids and kinds)
|
|
16227
|
+
- `drawCaseBoard(ctx, board, time, { drawCard? })`: the board at a time: cork, red strings stretching, cards popping up on pins, marker strokes; returns the nib point while a mark is drawn
|
|
16228
|
+
- `caseBoardMarkerTip(board, time)`: where the marker’s nib is (for a hand), or null
|
|
16229
|
+
- `caseCardBox(board, id)`: a card’s pin, centre and corners, scene px
|
|
16230
|
+
- `caseMarkPath(board, { on, kind })`: a mark’s stroke points
|
|
16231
|
+
- `drawPushPin(ctx, x, y, { color?, radius? })`: a red push pin
|
|
16232
|
+
- `drawMarkerStroke(ctx, points, progress, { color?, width? })`: the first part of a marker stroke; returns the nib
|
|
16233
|
+
|
|
16234
|
+
Case board cards: { id, x, y (its pin, relative to the board), kind?, title?, note?, width?, height?, angle?, color?, at?, highlight?: { at, duration } }, kinds `photo`, `note`. Strings: { from, to, at?, duration?, color? }. Marks: { on, kind, at, duration?, color?, width? }, kinds `cross` (two diagonals across the card, one after the other (ruled out)), `strike` (one diagonal, bottom-left to top-right (half ruled out)), `scribble` (a zigzag back and forth across the card (scribbled out)), `circle` (a loose ring round the card (this one)).
|
|
16235
|
+
|
|
15950
16236
|
## Code panel
|
|
15951
16237
|
|
|
15952
16238
|
`codePanel({ code, language, x, y, fontSize?, lineHeight?, width? })`: a code listing as a scene object. Languages: `go`, `rust`, `csharp`, `javascript`, `typescript`, `python`, `plain`. Remove styles: `wipe`, `fly`, `blur`.
|
package/llms.txt
CHANGED
|
@@ -13,49 +13,50 @@ Key facts:
|
|
|
13
13
|
- For language models: read the capability catalog first (`npx @algorisys/tinyfly capabilities`, or the end of llms-full.txt). It is generated from the library, so every name in it (poses, expressions, gags, gaits, beat actions, canvas properties, code-panel edits) is accepted, and names not in it are rejected with the name probably meant. Check beat scripts with `npx @algorisys/tinyfly check beats.json`, tracks with `checkTracks(tracks, targets)`, and ask any target what it animates with `describeTarget(target)`. The npm package ships `docs/`, `llms.txt`, `llms-full.txt` and an agent skill (`skills/tinyfly/SKILL.md`); `docs/llm-guide.md` describes the workflow.
|
|
14
14
|
- Source: https://github.com/algorisys-oss/tinyfly. License: MIT.
|
|
15
15
|
|
|
16
|
-
All documentation and the interactive course in a single file: [llms-full.txt](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
16
|
+
All documentation and the interactive course in a single file: [llms-full.txt](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/llms-full.txt)
|
|
17
17
|
|
|
18
18
|
## Start here
|
|
19
19
|
|
|
20
|
-
- [Getting Started](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
21
|
-
- [GSAP Compatibility](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
22
|
-
- [Code Examples](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
23
|
-
- [Building Animations with an LLM](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
20
|
+
- [Getting Started](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/getting-started.md): What tinyfly is, making a first animation in the editor, and using it from code, a script tag or the CDN.
|
|
21
|
+
- [GSAP Compatibility](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/gsap-compat.md): The GSAP-style API (`live.to`, `tf.timeline`): supported vars, motion paths, morphSVG, text, inertia, Draggable, Flip, and where it differs from GSAP.
|
|
22
|
+
- [Code Examples](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/examples.md): Recipes with the engine API: fades, loops, colour and bezier easing, loading JSON, canvas and SVG rendering, multi-scene sequences, motion paths and script-tag embeds; a festive garba/dandiya scene with partner contacts, circle travel and spins, also rendered to video.
|
|
23
|
+
- [Building Animations with an LLM](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/llm-guide.md): For assistants and the people setting them up: read the capability catalog (`tinyfly capabilities`), ask targets what they animate (`describeTarget`), check beats and tracks with did-you-mean errors (`tinyfly check`, `checkTracks`), render stills to look at, and the agent skill shipped in the package.
|
|
24
24
|
|
|
25
25
|
## Reference
|
|
26
26
|
|
|
27
|
-
- [API Reference](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
28
|
-
- [File Format](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
27
|
+
- [API Reference](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/api-reference.md): Every public engine, player and adapter API: Timeline, tracks, keyframes, easing, drivers, serialization and exports.
|
|
28
|
+
- [File Format](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/file-format.md): The JSON animation format: timelines, every track kind, keyframes, easing and the project file — for generating or consuming animations.
|
|
29
29
|
|
|
30
30
|
## Editor features
|
|
31
31
|
|
|
32
|
-
- [Editor Guide](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
33
|
-
- [Shape Morphing](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
34
|
-
- [Pen Tool](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
35
|
-
- [Polygons & Stars](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
36
|
-
- [Grid & Snapping](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
37
|
-
- [Onion Skinning](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
38
|
-
- [Sprite-sheet Export](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
32
|
+
- [Editor Guide](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/editor-guide.md): Every panel and feature of the visual editor, from elements and keyframes to text and inertia tracks, preview and export.
|
|
33
|
+
- [Shape Morphing](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/shape-morph.md): Tweening one path into another, including shapes with different point counts and several subpaths.
|
|
34
|
+
- [Pen Tool](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/pen-tool.md): Drawing custom paths point by point with straight segments and bezier curves.
|
|
35
|
+
- [Polygons & Stars](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/polygon-star.md): Parametric polygon and star shapes that stay editable while animating like any path.
|
|
36
|
+
- [Grid & Snapping](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/grid-and-snapping.md): The grid overlay, snapping to grid, elements and artboard centre, and alignment guides.
|
|
37
|
+
- [Onion Skinning](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/onion-skinning.md): Ghost frames before and after the playhead for judging arcs and easing.
|
|
38
|
+
- [Sprite-sheet Export](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/sprite-sheet-export.md): Exporting frames as a PNG grid plus JSON metadata for game engines and canvas players.
|
|
39
39
|
|
|
40
40
|
## Guides
|
|
41
41
|
|
|
42
|
-
- [Cricket Stories](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
43
|
-
- [Scroll Animation](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
44
|
-
- [Props: Everyday Objects with Behaviours](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
45
|
-
- [Teaching Animations](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
46
|
-
- [Maths Animations](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
47
|
-
- [Rendering Video from Code](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
48
|
-
- [Animated Maps](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
49
|
-
- [Cartoon Hands](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
50
|
-
- [
|
|
51
|
-
- [
|
|
52
|
-
- [
|
|
53
|
-
- [
|
|
54
|
-
- [3D
|
|
55
|
-
- [
|
|
56
|
-
- [
|
|
42
|
+
- [Cricket Stories](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/cricket.md): Reusable sports APIs, organic adult/child players, sixteen cricket plays, Test/ODI/T20 facts, contact-keyed JSON, captions, headless video and a 360° ground camera.
|
|
43
|
+
- [Scroll Animation](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/scroll-animation.md): Scroll-driven and play-when-visible animation with ScrollDriver and VisibilityDriver.
|
|
44
|
+
- [Props: Everyday Objects with Behaviours](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/props.md): Cars, trucks, buses, tractors, carts, train carriages, bikes, motorbikes, trees, houses, a helicopter and a plane: 3D rigs drawn with the characters’ pens (clean, pencil) that turn toward the camera, with beats acted through the 12 principles (anticipation, squash and stretch, follow-through, an exaggeration dial), wheels that roll exactly, effects, and figures riding them.
|
|
45
|
+
- [Teaching Animations](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/teaching.md): Step-through explanatory figures: markers, captions in several languages, the teaching player, step controls, one-script declarative embeds, tinyfly/teach diagram primitives, and validate / render for build pipelines.
|
|
46
|
+
- [Maths Animations](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/math.md): tinyfly/math: figures as JSON (grids a matrix warps, vectors, function plots, polygons, eigenlines, TeX labels and equations that rewrite step by step), animated by plain tracks, played in lesson-page embeds, explorables and videos from one layout; a built-in TeX subset and ready linear algebra figures.
|
|
47
|
+
- [Rendering Video from Code](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/video-rendering.md): Rendering a scene to MP4 without a browser: `tinyfly video`, custom canvas targets drawn by code, timing from narration and recorded voice-over, the stick-figure character, SRT/WebVTT captions, stills, porting Cairo scripts, and a benchmark against pycairo.
|
|
48
|
+
- [Animated Maps](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/maps.md): Maps that animate: a camera that flies in to a city, pins that drop in, routes that draw themselves while a marker travels them, on OpenStreetMap tiles or an offline world outline (also in pencil), in the browser and in headless video.
|
|
49
|
+
- [Cartoon Hands](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/cartoon-hands.md): A hand you can pose: a palm and five fingers in 3D, posed by numbers (curls, thumb, spread, wrist turn), ready-made shapes from a fist to a pencil grip, left and right, four or five fingers, in clean, pencil and silhouette looks; the animator's hand and character gloves are built on it.
|
|
50
|
+
- [Noir and Detective Scenes](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/noir-detective.md): A canvas kit for detective stories: rain in a window, light through blinds, darkness with torch beams and holes, glow, vignette, lightning and a flickering bulb; the red clue magnifier, an evidence folder, a clock and time chip, a freeze-frame suspect name card, a typed narration box and speech bubbles; and a case board as data (pinned photo and note cards, red string, marker cross-outs, strikes, scribble-outs and rings drawn on over time, with the marker nib for a hand). Deterministic from time; text and fonts are yours.
|
|
51
|
+
- [Character Appearance](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/character-appearance.md): Hair (34 styles), facial hair (20), glasses, hats and ears for the v2 character as plain data on the head, so they turn with it through all eight views; builds (child, tall, short…), a recurring cast (castMember), expressions with blush, tears and sweat, everyday poses, held items (mug, phone, bags, umbrella, parcel) and two characters’ hands meeting (meetHands: handshake, high five, hand-over).
|
|
52
|
+
- [Cartoon Acting](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/acting.md): actTracks(): the same key poses, acted: anticipation, overshoot and settle, overlapping joints, eyes that lead and blink, moving holds and jump squash, in full, snappy or limited styles; gags as data (take, double take, wind-up); a line of action (bend); gaits with personality; lip-sync from text (Latin and Devanagari); beat scripts compiled to acted tracks; your own actions (defineAction), gaits (defineGait) and personas (persona()); acting on code (codePanel lines and words as anchors: leap onto a line, point at it, swipe it away wiped, knocked off or blurred; grab, throw, kick, carry and drop words, push them along their line, write new text in by hand; ride a line as gaps close); camera shots (push in, cut, shake, follow); the cartoon zip; speed lines, dust puffs and impact stars; drawing on twos (a timeline setting); acting, gags, walks and lines in the editor.
|
|
53
|
+
- [Dance and Flips](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/dance.md): The stick figure dances disco, hip hop, breaking, jazz, K-pop, Bollywood, Bhangra, Bharatanatyam (with mudras), the Charleston, tap and popping, and does flips, leaps and splits; native v2 garba (two/three clap) and dandiya add body-local routines, circle formations, world foot plants, paired stick-tip contacts and signed spins; JSON bakes, timing, contact limits and editor menus.
|
|
54
|
+
- [3D Scenes](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/scene-3d.md): @algorisys/tinyfly/scene-3d: cameras, lights and meshes as JSON, in metres, animated by tracks at <scene>/<object> (cuts with activeCamera), drawn on a 2D canvas with flat, smooth or toon shading, ink outlines and fog, in browsers, Workers and Node (MP4 with tinyfly video); v2 characters in pen or solid looks, scripted native dances, timed signed spins and circle formations with foot contacts.
|
|
55
|
+
- [3D Transforms and Rotations](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/3d-rotations.md): CSS-style 3D for flat elements in every renderer (rotateX, rotateY, z, perspective, backface visibility; true perspective on Canvas and WebGL, matching CSS within a pixel), one documented transform order, the editor's 3D fields; smooth quaternion rotations with interpolation: "slerp"; the vec3, quat and mat4 helpers; format version 2.
|
|
56
|
+
- [Extending tinyfly](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/extending.md): Writing a render adapter, animating any object with live and the ticker, custom and parametric eases, stagger offsets, adding a track kind, and contributing gallery examples.
|
|
57
|
+
- [Deployment](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/docs/DEPLOYMENT.md): Building and hosting the editor, and serving the player bundles.
|
|
57
58
|
|
|
58
59
|
## Optional
|
|
59
60
|
|
|
60
|
-
- [README](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
61
|
-
- [Release notes](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
61
|
+
- [README](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/README.md): Feature overview, project layout and development setup.
|
|
62
|
+
- [Release notes](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.123.0/release-notes/README.md): What changed in each version.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algorisys/tinyfly",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.123.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Lightweight, API-driven animation engine and editor. The engine is framework-agnostic and runs in browsers, Web Workers, and Node.",
|
|
6
6
|
"license": "MIT",
|
package/skills/tinyfly/SKILL.md
CHANGED
|
@@ -38,6 +38,18 @@ names.
|
|
|
38
38
|
painted: light-weighted lines, shadow and highlight tones, tuned with
|
|
39
39
|
`illustrated: { light, weight, taper, shadow, highlight }`); anime is a face style.
|
|
40
40
|
The same `HUMAN_EXPRESSIONS`, blink, gaze, turn, acting and dance fields apply.
|
|
41
|
+
- White outlined stick figures: `figure: 'bean'` (or `castMember('beanMan' | 'beanWoman' | 'beanKid' | 'beanBoss' | 'beanDetective' | 'beanStick', height)`)
|
|
42
|
+
draws seamless outlined noodle limbs (`bean: { limbs: 'line' }` for bare lines), a shaped body, big oval eyes
|
|
43
|
+
(`face.style: 'oval'`), mittens and cartoon shoes; colour it with `bean: { shirt, sleeves, trousers, shoes }`;
|
|
44
|
+
detective gear `bean: { coat, fedora, shades: true }`; `halo` edges line limbs.
|
|
45
|
+
It is always drawn clean; every pose, gait, dance and expression field works on it.
|
|
46
|
+
Household clothes: `bean: { skirt, drape, bangles }` (`skirt` a colour or `{ color, length }`; preset `beanSari`).
|
|
47
|
+
- Detective / noir scenes: canvas functions, all pure in time (ms): `drawRain`, `drawBlinds`,
|
|
48
|
+
`drawDarkness` (torch `cones` with `angle` in degrees, `holes`), `drawGlow`, `drawVignette`,
|
|
49
|
+
`lightningFlash`, `lightFlicker`; overlays `drawClueMarker`, `drawEvidenceFolder`, `drawClockFace`,
|
|
50
|
+
`drawTimeChip`, `drawNameCard`, `drawNarrationBox`, `drawSpeechBubble`; a case board as data
|
|
51
|
+
(`caseBoard({ cards, strings, marks })`, `drawCaseBoard(ctx, board, time, { drawCard })` returns the
|
|
52
|
+
marker nib; marks `cross | strike | scribble | circle`). Text and fonts are the caller's.
|
|
41
53
|
|
|
42
54
|
- Prefer the high-level builders: `scriptTracks()` beats for characters
|
|
43
55
|
(`characterScript(target, who, beats)` for the same beats on a v2
|