@algorisys/tinyfly 0.99.0 β 0.100.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 +8 -8
- package/docs/acting.md +10 -6
- package/docs/character-appearance.md +45 -7
- package/docs/editor-guide.md +38 -3
- package/docs/examples.md +1 -1
- package/docs/getting-started.md +1 -1
- package/docs/gsap-compat.md +1 -1
- package/docs/llm-guide.md +20 -7
- package/docs/maps.md +2 -2
- package/docs/props.md +61 -1
- package/docs/teaching.md +1 -1
- package/lib/addons/characters.js +5882 -4858
- package/lib/browser/tinyfly.iife.js +14 -14
- package/lib/browser/tinyfly.js +7145 -6121
- package/lib/browser/tinyfly.umd.js +14 -14
- package/lib/types/characters/acting/character-script.d.ts +14 -2
- package/lib/types/characters/acting/script.d.ts +9 -0
- package/lib/types/characters/capabilities.d.ts +2 -0
- package/lib/types/characters/character.d.ts +8 -1
- package/lib/types/characters/hair-follow.d.ts +12 -6
- package/lib/types/characters/hands/held-items.d.ts +6 -2
- package/lib/types/characters/head/face.d.ts +6 -1
- package/lib/types/characters/index.d.ts +3 -2
- package/lib/types/characters/interactions.d.ts +60 -0
- package/lib/types/characters/props/families/animals.d.ts +6 -0
- package/lib/types/characters/props/families/birds.d.ts +16 -0
- package/lib/types/characters/props/families/furniture.d.ts +102 -0
- package/lib/types/characters/props/index.d.ts +1 -0
- package/lib/types/characters/props/presets.d.ts +15 -2
- package/lib/types/characters/props/ride-3d.d.ts +4 -1
- package/lib/types/characters/scenery.d.ts +126 -0
- package/lib/types/characters/species/human-motion.d.ts +17 -0
- package/lib/types/characters/species/human.d.ts +6 -0
- package/lib/types/characters/wardrobe/basic-outfit.d.ts +16 -5
- package/llms-full.txt +205 -40
- package/llms.txt +29 -29
- package/package.json +2 -2
- package/skills/tinyfly/SKILL.md +13 -6
package/README.md
CHANGED
|
@@ -54,14 +54,14 @@ A lightweight, API-driven animation engine and visual editor for creating high-p
|
|
|
54
54
|
- **Code-drawn targets** - A `custom` canvas target draws with code (characters, charts, props) while the timeline animates its position, opacity and its own `props`, so drawing stays code and timing stays JSON
|
|
55
55
|
- **Immediate mode too** - A scene's `background` and `draw(ctx, { time })` functions paint each frame directly, Cairo/Processing-style, and mix freely with timeline targets
|
|
56
56
|
- **Timing from narration** - `planNarration()` lays spoken lines out from their clip lengths (lead, gap, tail) into cues, scene spans and markers; `voiceNarration()` measures recorded clips with ffmpeg and writes the sample-aligned narration WAV
|
|
57
|
-
- **Characters** - A poseable stick figure (`@algorisys/tinyfly/characters`): named poses, facial expressions (brows, eyes that widen, close and look around, mouth shapes), squash and stretch, rubber-hose limbs, blending, walk cycles and talking, all driven by timeline tracks. **Characters v2**: one skeleton in 3D drawn flat, turning front to side to back, resting on whatever touches the ground, reaching for points, in clean, pencil or silhouette looks, and a π§ Character element in the editor you pose and keyframe. **Character appearance**: 34 hairstyles, 20 facial-hair styles, glasses, hats and ears as plain data on the head (they turn with it through all eight views), builds from toddler to tall, a recurring cast (`castMember`), 30 expressions with blush, tears and sweat, and hair that swings after a turn or a run and settles (`hairFollowTracks` keys the lag from the character's own tracks, so drawing stays stateless); four-legged animals' ears lay back on a run the way their tails already trail ([guide](docs/character-appearance.md))
|
|
57
|
+
- **Characters** - A poseable stick figure (`@algorisys/tinyfly/characters`): named poses, facial expressions (brows, eyes that widen, close and look around, mouth shapes), squash and stretch, rubber-hose limbs, blending, walk cycles and talking, all driven by timeline tracks. **Characters v2**: one skeleton in 3D drawn flat, turning front to side to back, resting on whatever touches the ground, reaching for points, in clean, pencil or silhouette looks, and a π§ Character element in the editor you pose and keyframe. **Character appearance**: 34 hairstyles, 20 facial-hair styles, glasses, hats and ears as plain data on the head (they turn with it through all eight views), builds from toddler to tall, a recurring cast (`castMember`), 30 expressions with blush, tears and sweat, and hair that swings after a turn or a run and settles (`hairFollowTracks` keys the lag from the character's own tracks, so drawing stays stateless); four-legged animals' ears lay back on a run the way their tails already trail. Clothes are data too (`outfit.over`: an apron, a lab coat, a hoodie, a cardigan, overalls, a sari; boots), a mouth opens on teeth and a tongue, feet come in shapes, two people hug and help each other up (`embrace`, `helpUp`), and a cane in the hand or a wheelchair to ride are accessories any character can have, not part of an age ([guide](docs/character-appearance.md))
|
|
58
58
|
- **Dance and flips** - The stick figure dances disco, hip hop, breaking toprock, jazz, K-pop, Bollywood, Bhangra, Bharatanatyam (with mudras), the Charleston, tap (foot strikes as data, for tap sounds) and popping (side glide, moonwalk, forward glide, which travel with the planted foot staying put), and does front, back, layout, scissor and side flips, cartwheels, back handsprings, split leaps, toe touches and full splits. Wrists, ankles, foot turn-out, whole-body `spin` and `rise` are pose fields; moves are keyed in beats, so any tempo plays them; styles, grooves and routines are plain JSON (`danceFrame()`, `danceTracks()`, `flipPose()`, `flipTracks()`). In the editor a π§ Character dances from the playhead, in time with the music: an Audio element's tempo is detected (`detectTempo()`) or tapped, the timeline shows its beats and bars, and keyframes snap to them. See [docs/dance.md](docs/dance.md)
|
|
59
59
|
- **Maps** - Animated maps on OpenStreetMap tiles or an offline world outline (also in pencil): the camera flies in, pins drop, routes draw themselves while a marker travels them; a πΊ Map element in the editor with a one-click trip
|
|
60
60
|
- **Pencil sketch style** - Hand-drawn strokes with line boil (`sketch` style, `sketchPen`) for a pencil-test, Pencilmation-like look, on the stick figure and on canvas rect / circle / line / path shapes (also from the editor's Properties panel); a `drawOn` track draws any of those shapes on; the wobble is seeded by time, so renders stay deterministic
|
|
61
61
|
- **The drawing hand** - `drawnPathTarget()` draws a sketched stroke on from a `draw` track while a cartoon hand holds the pencil at its end in a writing grip; the same hand can hold the eraser. `handAt()` gives one hand for a whole scene: it follows each stroke, lifts and glides to the next, and enters and leaves the page
|
|
62
62
|
- **Erasing** - An eraser rubs out part of a target (`erasable()`, animated by an `erase` track) or of anything drawn in code (`withErased()`); clip-based, so it works in the browser and headless alike
|
|
63
63
|
- **Cartoon hands** - A hand rig in 3D, drawn flat: thumb and fingers posed by numbers (`index.curl`, `thumb.across`, `spread`, `turn`), ready-made shapes (fist, point, thumbs-up, peace, OK, pinch, wave, pencil gripβ¦), left and right, four or five fingers, in every look; the animator's hand and (opt-in) character gloves are built on it. See [docs/cartoon-hands.md](docs/cartoon-hands.md)
|
|
64
|
-
- **Cartoon acting** - `actTracks()` turns the same key poses into acted motion: wind-ups, overshoot that settles or wobbles, joints that overlap (hips lead, wrists drag), eyes that dart ahead and blink on head turns, moving holds and jump squash, in `full`, `snappy` or `limited` styles. Gags come as data (`gag('take')`, double take, wind-up, tremble). A line of action (`bend`) curves the spine, and gaits have personality (bouncy, double bounce, sneak, strut, tired, run). Lip-sync works from text, Latin or Devanagari. `scriptTracks()` compiles a story written as beats (`{ do: 'walk', to: 640 }`, `{ do: 'take' }`, `{ do: 'say', say: 'β¦' }`) into all of it, and `characterScript()` compiles the same beats for a v2 character from the cast, on its own body and stride. `cameraTracks()` films it with push-ins, cuts, shakes and follows. The cartoon zip (`{ do: 'zip' }`) has the legs wheel in place before it is gone. Figures can act on code, Animator vs Animation style: `codePanel()` lays a listing out so every line and word is a place in the scene, and beats leap onto lines, point at them and swipe them away (`{ do: 'swipe', target: code.line(7) }`), with the line wiped, knocked off the panel or blurred out of focus on the frames the hand crosses it. Words come loose too: a figure grabs `var` and throws it, kicks another out of a loop, carries a stray `;` to where it belongs, pushes a word along its line (the text closing up behind it), and writes `mut` into a line by hand. A figure standing on a line rides it when a gap above closes (`code.ride()`). Code is one *surface*; `whiteboard()` is another, a board or chalkboard of texts and hand-drawn circles, boxes, underlines and arrows, so a figure can work through a lesson that is not code, `chart()` a third, bar, line, pie and donut charts whose bars a figure points at, highlights and stands on as they grow, with slices it pulls out or kicks loose as pieces, several series with a legend, and axis titles, and `propSurface()` makes any prop one, so a figure opens a car's door or switches a house's lights on, kicks a wheel loose (parts are pieces), and rides on the roof as the car lifts (anchors and parts are floors). Boards write in a handwriting font, bend arrows round what is in the way, and come as ruled paper too. In the editor, a π§ Character's **Beats** box compiles a story into its tracks, aimed at a β¨ **Code** element's lines, and riders drive or pedal (`RIDING_POSES.driving`, `pedallingKeys`). Places on a surface have names (`line:7`, `token:4:Println`, `term:eq:+ 4`), and `surfaceScript()` takes a whole scene as JSON: beats aim at named places and say what the surface does in answer, at the moment the hand touches or lets go. Props give the story a world: cars, trucks, buses, tractors, carts, train carriages, bikes, motorbikes, trees, houses, a helicopter and a plane, a horse, dogs, cats, cows and birds are 3D rigs drawn with the figures' pens, so they turn toward the camera and boil in pencil, or as line art beside stick figures. They act from beats through the same principles (they rock back before they go, dip on the stop, skid, bump, sway, take off and loop; animals walk, trot and gallop with their feet keeping pace, sit and jump; birds hop, peck, flap and fly up to a perch), with an exaggeration dial, and figures can ride them. See [docs/props.md](docs/props.md). Your own behaviours are plain values: `defineAction()` (from beats or timed pose steps), `defineGait()`, and `persona()` for a recurring character's look, acting style, gait, usual face and stance. In the editor, a Character's **Acting** section acts its keyed poses in a style and adds gags, walks in a gait and lip-synced lines, with drawing on twos as a timeline setting. Characters come in builds (slim, kid, broad, curvy, stocky), and the v2 human has its own line of action, gaits and gags, posed in 3D so they read from every view. It also adds speed lines from earlier frames (`drawStickSmear()`), dust puffs, impact stars, and drawing on twos for video (`drawingRate`). Output is plain keyframes. See [docs/acting.md](docs/acting.md)
|
|
64
|
+
- **Cartoon acting** - `actTracks()` turns the same key poses into acted motion: wind-ups, overshoot that settles or wobbles, joints that overlap (hips lead, wrists drag), eyes that dart ahead and blink on head turns, moving holds and jump squash, in `full`, `snappy` or `limited` styles. Gags come as data (`gag('take')`, double take, wind-up, tremble). A line of action (`bend`) curves the spine, and gaits have personality (bouncy, double bounce, sneak, strut, tired, run). Lip-sync works from text, Latin or Devanagari. `scriptTracks()` compiles a story written as beats (`{ do: 'walk', to: 640 }`, `{ do: 'take' }`, `{ do: 'say', say: 'β¦' }`) into all of it, and `characterScript()` compiles the same beats for a v2 character from the cast, on its own body and stride. `cameraTracks()` films it with push-ins, cuts, shakes and follows. The cartoon zip (`{ do: 'zip' }`) has the legs wheel in place before it is gone. Figures can act on code, Animator vs Animation style: `codePanel()` lays a listing out so every line and word is a place in the scene, and beats leap onto lines, point at them and swipe them away (`{ do: 'swipe', target: code.line(7) }`), with the line wiped, knocked off the panel or blurred out of focus on the frames the hand crosses it. Words come loose too: a figure grabs `var` and throws it, kicks another out of a loop, carries a stray `;` to where it belongs, pushes a word along its line (the text closing up behind it), and writes `mut` into a line by hand. A figure standing on a line rides it when a gap above closes (`code.ride()`). Code is one *surface*; `whiteboard()` is another, a board or chalkboard of texts and hand-drawn circles, boxes, underlines and arrows, so a figure can work through a lesson that is not code, `chart()` a third, bar, line, pie and donut charts whose bars a figure points at, highlights and stands on as they grow, with slices it pulls out or kicks loose as pieces, several series with a legend, and axis titles, and `propSurface()` makes any prop one, so a figure opens a car's door or switches a house's lights on, kicks a wheel loose (parts are pieces), and rides on the roof as the car lifts (anchors and parts are floors). Boards write in a handwriting font, bend arrows round what is in the way, and come as ruled paper too. In the editor, a π§ Character's **Beats** box compiles a story into its tracks, aimed at a β¨ **Code** element's lines or a π **Chart** element's bars (which carry the figure as they grow), and riders drive or pedal (`RIDING_POSES.driving`, `pedallingKeys`). Places on a surface have names (`line:7`, `token:4:Println`, `term:eq:+ 4`), and `surfaceScript()` takes a whole scene as JSON: beats aim at named places and say what the surface does in answer, at the moment the hand touches or lets go. Props give the story a world: cars, trucks, buses, tractors, carts, train carriages, bikes, motorbikes, trees, houses, a helicopter and a plane, furniture with the places a figure uses them at (a chair, a desk, a bed, a door, a wheelchair), a horse, dogs, cats, cows, goats, rabbits, squirrels and birds from songbirds to owls and parrots are 3D rigs drawn with the figures' pens, so they turn toward the camera and boil in pencil, or as line art beside stick figures. They act from beats through the same principles (they rock back before they go, dip on the stop, skid, bump, sway, take off and loop; animals walk, trot and gallop with their feet keeping pace, sit and jump; birds hop, peck, flap and fly up to a perch), with an exaggeration dial, and figures can ride them. `scenery()` puts a sky over it all (the sun and moon on their arcs, clouds on the wind, rain and snow, hills or a city) or a room with a window, with the hour, the clouds and the weather as tracks, and `scenePreset` gives park, street, office and home scenes. See [docs/props.md](docs/props.md). Your own behaviours are plain values: `defineAction()` (from beats or timed pose steps), `defineGait()`, and `persona()` for a recurring character's look, acting style, gait, usual face and stance. In the editor, a Character's **Acting** section acts its keyed poses in a style and adds gags, walks in a gait and lip-synced lines, with drawing on twos as a timeline setting. Characters come in builds (slim, kid, broad, curvy, stocky), and the v2 human has its own line of action, gaits and gags, posed in 3D so they read from every view. It also adds speed lines from earlier frames (`drawStickSmear()`), dust puffs, impact stars, and drawing on twos for video (`drawingRate`). Output is plain keyframes. See [docs/acting.md](docs/acting.md)
|
|
65
65
|
- **Pencil story example** - `examples/pencil-story-hindi/index.html` tells a short Hindi story (ΰ€ͺΰ₯ΰ€―ΰ€Ύΰ€Έΰ€Ύ ΰ€°ΰ€Ύΰ€Ήΰ€ΰ₯ΰ€°, the thirsty traveller) Pencilmation-style with the browser bundle alone: the hand draws the scene and writes the narration, then rubs out the pot
|
|
66
66
|
- **Captions** - `toSRT()` / `toWebVTT()` from narration cues or from a timeline's markers
|
|
67
67
|
|
|
@@ -91,7 +91,7 @@ A lightweight, API-driven animation engine and visual editor for creating high-p
|
|
|
91
91
|
|
|
92
92
|
### Visual Editor
|
|
93
93
|
- **AI prompt β animation** - Describe an animation in plain language ("a title that fades up with a shine", "three cards sliding in one after another") and generate a fully editable timeline. Bring your own API key for **OpenAI, Google Gemini, or Anthropic** β keys stay in your browser and are sent directly to the provider. The model emits tinyfly's JSON schema, which loads through the same path as the editable examples, so generated animations are ordinary keyframes you can tweak. Ask for a story and it casts a character (`cast: 'grandma'`) and writes its beats (walk, look, a take, a line, a zip) rather than keyframes; the beats compile on load with `characterScript()` and stay on the element
|
|
94
|
-
- **Any canvas / aspect ratio** - The preview artboard follows the project canvas (DOM, Canvas, and SVG renderers) and fits-to-view, so a vertical 9:16 promo or any custom size previews at true proportions; samples can declare their own canvas size
|
|
94
|
+
- **Any canvas / aspect ratio** - The preview artboard follows the project canvas (DOM, Canvas, and SVG renderers), with elements selected, dragged and resized on the stage in all three, and fits-to-view, so a vertical 9:16 promo or any custom size previews at true proportions; samples can declare their own canvas size
|
|
95
95
|
- **Device-frame preset** - One click stamps a device mockup (rounded body, camera/notch, and a rounded video "screen") sized to the canvas, in **Phone / Landscape / Tablet** variants β drop a screen-recording into the screen's source for an app promo
|
|
96
96
|
- **Timeline view** - Visual keyframe editing with drag-and-drop
|
|
97
97
|
- **Camera** - Animate a pan/zoom/rotate over the whole stage (a reserved `Camera` layer driven by ordinary tracks). One-click add, a **π₯ Camera inspector** (Pan/Zoom/Rotation keyframed at the playhead), on-stage **β Pan** dragging, and a dedicated π₯ lane at the top of the timeline; applies in every preview, export, and embed. Ready-made Push In / Pan Across / Orbit Reveal samples
|
|
@@ -189,7 +189,7 @@ for what you import:
|
|
|
189
189
|
| `@algorisys/tinyfly/teach` | `lesson()` step builder and diagram primitives (cells, pointer, stack, queue, table, pipeline) | Anywhere |
|
|
190
190
|
| `@algorisys/tinyfly/react`, `@algorisys/tinyfly/vue`, `@algorisys/tinyfly/svelte`, `@algorisys/tinyfly/solid` | `useTinyfly` hooks, a Svelte action and a Solid primitive: `live` animations scoped to a component and reverted on unmount | Browser (frameworks are optional peer dependencies) |
|
|
191
191
|
| `@algorisys/tinyfly/maps` | Animated maps: OpenStreetMap tiles or an offline world outline, places, routes that draw on, a camera that flies (`mapTarget`, `mapFlyTracks`, `fitView`, `WORLD_CITIES`) | Anywhere with a Canvas 2D context (tiles need a network) |
|
|
192
|
-
| `@algorisys/tinyfly/characters` | Poseable stick figure: `stickFigureTarget`, `poseTracks`, `POSES`, `blendPose`, `walkPose`, `drawStickFigure`; `stickFigureJoints` and `layers` for costumes, hair and props; `turn`, `sit` and ground contact; an organic look by default (`classic` keeps the old one); **characters v2**: `character()` / `characterTarget()`, turnarounds front to back, contact, reaching, clean / pencil / silhouette looks; `hair`, `facialHair`, `glasses`, `hat`, `ears`, `build`, `outfit` as data, `castMember()`, `HUMAN_EXPRESSIONS` with face marks | Anywhere with a Canvas 2D context |
|
|
192
|
+
| `@algorisys/tinyfly/characters` | Poseable stick figure: `stickFigureTarget`, `poseTracks`, `POSES`, `blendPose`, `walkPose`, `drawStickFigure`; `stickFigureJoints` and `layers` for costumes, hair and props; `turn`, `sit` and ground contact; an organic look by default (`classic` keeps the old one); **characters v2**: `character()` / `characterTarget()`, turnarounds front to back, contact, reaching, clean / pencil / silhouette looks; `hair`, `facialHair`, `glasses`, `hat`, `ears`, `face`, `feet`, `build`, `outfit` as data, `castMember()`, `HUMAN_EXPRESSIONS` with face marks; `embrace`, `helpUp`, `scenery` | Anywhere with a Canvas 2D context |
|
|
193
193
|
| `@algorisys/tinyfly/headless` | `renderVideo`, `renderStills`, `FrameRenderer`: render a scene to MP4 or PNGs (see [Rendering Video from Code](docs/video-rendering.md)) | Node (`@napi-rs/canvas` optional peer, ffmpeg) |
|
|
194
194
|
| `@algorisys/tinyfly/browser` | One script-tag bundle (`tinyfly.iife.js`): the engine, player, drivers, interaction, the GSAP-style `live` / `tf` facades, teaching-embed controls and mounting, and the `characters` stick figure. Not included: `export`, `adapters`, `teach`, the framework hooks, `headless` | Browser |
|
|
195
195
|
|
|
@@ -237,7 +237,7 @@ GSAP-shaped functions at the top level. Teaching embeds are included: add
|
|
|
237
237
|
itself.
|
|
238
238
|
|
|
239
239
|
```html
|
|
240
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
240
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.100.0/cdn/tinyfly.iife.js"></script>
|
|
241
241
|
<script>
|
|
242
242
|
tinyfly.to('.box', { x: 200, rotate: 90, duration: 1, ease: 'power2.out' })
|
|
243
243
|
|
|
@@ -273,7 +273,7 @@ A teaching figure needs no code at all:
|
|
|
273
273
|
<script type="application/json" data-tinyfly-timeline>{ β¦timeline JSON with markersβ¦ }</script>
|
|
274
274
|
<figcaption>Appending to a full slice</figcaption>
|
|
275
275
|
</figure>
|
|
276
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
276
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.100.0/cdn/tinyfly.iife.js" data-tinyfly-auto></script>
|
|
277
277
|
```
|
|
278
278
|
|
|
279
279
|
See [Teaching Animations](docs/teaching.md).
|
|
@@ -372,7 +372,7 @@ Without a build step, the player bundle puts the same functions on a `tinyfly` g
|
|
|
372
372
|
<div data-tinyfly="box" style="width: 60px; height: 60px; background: #4a9eff;"></div>
|
|
373
373
|
</div>
|
|
374
374
|
|
|
375
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
375
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.100.0/cdn/tinyfly-player.iife.js"></script>
|
|
376
376
|
<script>
|
|
377
377
|
tinyfly.play('#animation', './animation.json', { loop: -1 })
|
|
378
378
|
</script>
|
|
@@ -481,7 +481,7 @@ Or skip the code entirely with declarative embeds (see [Teaching Animations](doc
|
|
|
481
481
|
<svg viewBox="0 0 720 200">β¦</svg>
|
|
482
482
|
<script type="application/json" data-tinyfly-timeline>{ β¦timeline JSONβ¦ }</script>
|
|
483
483
|
</figure>
|
|
484
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
484
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.100.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
|
|
485
485
|
```
|
|
486
486
|
|
|
487
487
|
### Audio / Video Sync
|
package/docs/acting.md
CHANGED
|
@@ -283,9 +283,13 @@ overshoots and overlaps on this body, and the lines are lip-synced over its
|
|
|
283
283
|
mouth. The walk phase is rekeyed to the character's own stride (its height and
|
|
284
284
|
legs: a child takes shorter steps), so its feet stay planted. The `walk`,
|
|
285
285
|
`walking` and `gait` tracks step the gait as the target draws
|
|
286
|
-
(`characterPoseOf(props)` folds them into the pose, for drawing by hand).
|
|
287
|
-
|
|
288
|
-
|
|
286
|
+
(`characterPoseOf(props)` folds them into the pose, for drawing by hand). Reaches
|
|
287
|
+
are planned for the character's own arms and legs (`reach`, the share of the
|
|
288
|
+
stick figure's reach its limbs have, so it steps to where they reach), and
|
|
289
|
+
while a beat's hand or foot is on its target the limb is re-aimed on the
|
|
290
|
+
human body: a `point` aims at the spot, a `grab`, `put` or `kick` lands on it
|
|
291
|
+
(leaning down to a low one), and a `swipe`, `write` or `push` follows where
|
|
292
|
+
the stick figure's palm went. Your own gaits go in
|
|
289
293
|
`options.gaits` for the script and `gaits` on `characterTarget` so the drawing
|
|
290
294
|
knows them too.
|
|
291
295
|
|
|
@@ -757,6 +761,6 @@ timeline plays: editor previews, players, embeds and exports.
|
|
|
757
761
|
|
|
758
762
|
## Not yet
|
|
759
763
|
|
|
760
|
-
-
|
|
761
|
-
|
|
762
|
-
|
|
764
|
+
- Beat scripts for v2 characters acting on surfaces directly (`surfaceScript`
|
|
765
|
+
drives the stick figure; in the editor, a Character's Beats box resolves
|
|
766
|
+
surface places and cues for it)
|
|
@@ -185,6 +185,11 @@ Beards: `none`, `stubble`, `goatee`, `soulPatch`, `chinStrap`, `circle`,
|
|
|
185
185
|
The crown sits over the hair; hair below the brim still shows.
|
|
186
186
|
- `ears: true` adds ears: they stick out past the head from the front and
|
|
187
187
|
behind, and sit on the head with a curl when turned toward the viewer.
|
|
188
|
+
- `face: { teeth: true, tongue: true }` shows a row of upper teeth hanging
|
|
189
|
+
from the top of the mouth, and a tongue lying in the bottom of it, whenever
|
|
190
|
+
the mouth opens past 0.3 (a laugh, a shout, a wail). The mouth's shape is
|
|
191
|
+
still the pose's `mouth`, `smile` and `mouthWidth`; a closed or barely open
|
|
192
|
+
mouth shows neither. Default: neither, so a plain face draws as before.
|
|
188
193
|
|
|
189
194
|
## Builds
|
|
190
195
|
|
|
@@ -201,9 +206,16 @@ field can still be set on its own (`headSize`, `shoulderWidth`, `hipWidth`,
|
|
|
201
206
|
| `broad`, `curvy`, `stocky` | Shoulder and hip widths (stocky: a larger head) |
|
|
202
207
|
| `kid`, `child`, `toddler` | Larger head, shorter limbs |
|
|
203
208
|
|
|
209
|
+
`feet` sets the feet's shape: `round` (the default blob), `flat` (a shoe,
|
|
210
|
+
longer and even), `pointed` (a slipper, tapering to the toe) or `big` (clown's
|
|
211
|
+
feet, half as long again and wide). The shape is clearest in profile, where
|
|
212
|
+
the foot points along the ground; from the front it points at the viewer.
|
|
213
|
+
|
|
204
214
|
Age, posture and accessories are separate choices: a child build is only
|
|
205
215
|
proportions, and an older character is shown by hair and glasses, never by a
|
|
206
|
-
stoop unless one is posed.
|
|
216
|
+
stoop unless one is posed. A cane (`holding: { right: 'cane' }`) and a
|
|
217
|
+
wheelchair (the `wheelchair()` prop, ridden in the `wheeling` pose) are
|
|
218
|
+
accessories any character can have, not part of an age. The same poses, gaits and actions work on every
|
|
207
219
|
build; `humanGaitStrideLength(gait, height, stride, legLength)` gives a build's
|
|
208
220
|
stride so its feet stay planted.
|
|
209
221
|
|
|
@@ -224,7 +236,8 @@ character({ outfit: { over: 'labCoat' } })
|
|
|
224
236
|
| `bottom` | `trousers` (default), `shorts`, `skirt` |
|
|
225
237
|
| `collar` | `true` for a shirt collar |
|
|
226
238
|
| `tie` | A colour, for a tie down the front |
|
|
227
|
-
| `over`, `overColor` | `apron` or `
|
|
239
|
+
| `over`, `overColor` | `apron`, `labCoat`, `hoodie` (a loose top with a hood at the back, a front pocket and long sleeves), `cardigan` (open down the front, buttoned), `overalls` (a bib with straps, in the trousers' colour) or `sari` (a drape to the ankles with the pallu over the near shoulder), and its colour |
|
|
240
|
+
| `shoes`, `shoeColor` | `boots` to above the ankle, and their colour |
|
|
228
241
|
|
|
229
242
|
The front details (collar, tie, apron, the coat's opening) show from the
|
|
230
243
|
front and turn away with the body; from behind an apron shows its ties.
|
|
@@ -243,6 +256,28 @@ family: `boy`, `girl`, `youngMan`, `youngWoman`, `man`, `woman`, `grandpa`,
|
|
|
243
256
|
const family = ['man', 'woman', 'girl', 'grandma'].map((name) => character(castMember(name, 280)))
|
|
244
257
|
```
|
|
245
258
|
|
|
259
|
+
## Hugs, help-ups and everyday cycles
|
|
260
|
+
|
|
261
|
+
Two people, more than hands: `embrace(a, b)` is a hug. Both turn toward each
|
|
262
|
+
other, lean in and tilt their heads together, and each reaches its right arm
|
|
263
|
+
over the other's shoulder and its left round the other's waist, exactly, from
|
|
264
|
+
where the two stand (`embraceSpacing(a, b)` apart). `helpUp(helper, sitter,
|
|
265
|
+
progress)` is one person helping another up off the floor as a function of how
|
|
266
|
+
far along it is: at 0 the sitter sits on the floor and the helper bows to take
|
|
267
|
+
its hand, at 1 both stand, and in between the hands stay joined at a point
|
|
268
|
+
that rises with them (`helpUpSpacing(helper, sitter)` apart). Both return
|
|
269
|
+
plain poses (`a`, `b`, or `helper`, `sitter`) and whether they `reached`.
|
|
270
|
+
|
|
271
|
+
```js
|
|
272
|
+
const hug = embrace({ character: cook, x: 300 }, { character: grandpa, x: 300 + embraceSpacing(cook, grandpa) })
|
|
273
|
+
const rising = helpUp({ character: cook, x: 300 }, { character: grandpa, x: 300 + helpUpSpacing(cook, grandpa) }, 0.5)
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
Everyday actions as cycles, like a gait: `humanCyclePose('sweeping', phase,
|
|
277
|
+
base)` sweeps a broom side to side (hold one: `holding: { right: 'broom' }`)
|
|
278
|
+
and `'brushing'` works a hand across a surface in front at chest height; `phase`
|
|
279
|
+
0 β 1 is one stroke and back. The Help Up card shows all three.
|
|
280
|
+
|
|
246
281
|
## Expressions and face marks
|
|
247
282
|
|
|
248
283
|
`HUMAN_EXPRESSIONS` sets every face field, so applying one replaces the whole
|
|
@@ -273,11 +308,14 @@ character({ holding: { left: 'bag', right: 'bag' } }) // carry
|
|
|
273
308
|
character({ holding: { both: { item: 'parcel', color: '#c9a06a' } } })
|
|
274
309
|
```
|
|
275
310
|
|
|
276
|
-
Items: `mug`, `phone`, `briefcase`, `bag`, `umbrella` and `
|
|
277
|
-
`left` or `right`), `book` (one hand or `both`) and `parcel` (`both`). Each is
|
|
311
|
+
Items: `mug`, `phone`, `briefcase`, `bag`, `umbrella`, `broom` and `cane` (one
|
|
312
|
+
hand, `left` or `right`), `book` (one hand or `both`) and `parcel` (`both`). Each is
|
|
278
313
|
drawn at the hand's grip, so it follows the hand through any pose, gait or
|
|
279
314
|
turn, and sorts with that arm (a mug goes behind the body with the far arm).
|
|
280
|
-
An umbrella's canopy sits just over the head.
|
|
315
|
+
An umbrella's canopy sits just over the head. A cane's crook is in the hand
|
|
316
|
+
and its shaft reaches the ground while the hand hangs, lifting with the hand
|
|
317
|
+
once it rises; `HUMAN_POSES.cane` stands leaning on it (the arm straight, a
|
|
318
|
+
little ahead), and any gait walks with it. `handGrip(joints, side)` gives
|
|
281
319
|
the grip point and the forearm's direction for drawing anything else in a
|
|
282
320
|
hand.
|
|
283
321
|
|
|
@@ -305,8 +343,8 @@ const give = meetHands('handOver', { character: courier, x: 300 }, { character:
|
|
|
305
343
|
|
|
306
344
|
Select a π§ Character and open **Head** in the properties: **Cast** dresses it
|
|
307
345
|
as a cast member (build, hair, facial hair, glasses and clothes in one step),
|
|
308
|
-
then **Hair**, **Hair colour**, **Facial hair**, **Glasses**, **Hat
|
|
309
|
-
**Ears** change one thing at a time; **Right hand**, **Left hand** and **Both
|
|
346
|
+
then **Hair**, **Hair colour**, **Facial hair**, **Glasses**, **Hat**,
|
|
347
|
+
**Ears**, **Teeth**, **Tongue** and **Feet** change one thing at a time; **Right hand**, **Left hand** and **Both
|
|
310
348
|
hands** put an item in them. **Build** lists the builds, with **Legs** and
|
|
311
349
|
**Arms** sliders. The new expressions and everyday poses are in the **Face**
|
|
312
350
|
and **Body** lists. All of it is saved as plain fields on the element and
|
package/docs/editor-guide.md
CHANGED
|
@@ -82,6 +82,7 @@ Shapes, text, images, video, lines, arrows and paths are added from the
|
|
|
82
82
|
| **πΊ Map** | An animated map: places, a route between them, and a camera (see [Maps](#maps)) |
|
|
83
83
|
| **π§ 3D Scene** | A real 3D scene seen through its camera: meshes, lights, characters and props (see [3D Scenes](#3d-scenes)) |
|
|
84
84
|
| **β¨ Code** | A code panel whose lines a Character's beats aim at and change (see [Code](#code)) |
|
|
85
|
+
| **π Chart** | A bar, line, pie or donut chart from data, whose bars and slices beats aim at, change and ride (see [Charts](#charts-1)) |
|
|
85
86
|
|
|
86
87
|
Polygon and star are **parametric** paths: change the sides/points/inner ratio in
|
|
87
88
|
the Property Panel and the shape regenerates, and they rescale cleanly when you
|
|
@@ -221,11 +222,13 @@ Dances and flips are written as they are, and turn acting off.
|
|
|
221
222
|
character's tracks and kept on the element (`beats` in the JSON). Write them
|
|
222
223
|
as JSON (`[{ "do": "walk", "to": 320, "mood": "happy" }, { "do": "say",
|
|
223
224
|
"say": "Hello!" }, { "do": "take" }]`) and click **π¬ Run beats**; the
|
|
224
|
-
timeline grows to fit. A beat can aim at a **β¨ Code** element's lines
|
|
225
|
+
timeline grows to fit. A beat can aim at a **β¨ Code** element's lines or a
|
|
226
|
+
**π Chart** element's bars, points and slices
|
|
225
227
|
(`"target": { "surface": "Code 1", "anchor": "line:2" }`, also for `to`,
|
|
226
228
|
`toward` and `onto`) and change them (`"then": { "surface": "Code 1",
|
|
227
229
|
"edit": "highlight", "anchor": "line:2", "at": "contact" }`): the edits
|
|
228
|
-
become tracks on that element
|
|
230
|
+
become tracks on that element, and a figure standing on a bar or a line
|
|
231
|
+
rides it as it moves. Problems are named by beat (an unknown
|
|
229
232
|
action, mood or place) before anything is written. The AI prompt bar writes
|
|
230
233
|
beats this way too.
|
|
231
234
|
|
|
@@ -310,6 +313,28 @@ Its tracks are on the element, named `object.property` (`box.rotateY`,
|
|
|
310
313
|
DOM and Canvas previews and in GIF / WebP / MP4 export. See [3D
|
|
311
314
|
Scenes](scene-3d.md) for the same from code.
|
|
312
315
|
|
|
316
|
+
### Charts
|
|
317
|
+
|
|
318
|
+
A **π Chart** element is a `chart()` from code: a bar, line, pie or donut
|
|
319
|
+
chart drawn by code into its box. In the property panel: the **Kind**,
|
|
320
|
+
**Title**, **Theme** (light or dark), **Max** (the top of the scale; blank
|
|
321
|
+
for a round number above the data), **Value labels** (a prefix, a suffix,
|
|
322
|
+
decimal places, and whether to show them), **Axis titles**, the **Data** as
|
|
323
|
+
JSON (`[{ "id": "q1", "label": "Q1", "value": 45 }, β¦]`; `"hidden": true`
|
|
324
|
+
starts a bar, point or slice out of sight) and, for several series, the
|
|
325
|
+
**Series** (`[{ "id": "plan", "label": "Plan" }, β¦]`, each datum then with
|
|
326
|
+
`"values": { "plan": 40, β¦ }`). Bad data is named under the fields instead of
|
|
327
|
+
breaking the stage.
|
|
328
|
+
|
|
329
|
+
Its bars, points and slices are places. A Character's **Beats** aim at them
|
|
330
|
+
(`{ "surface": "Chart 1", "anchor": "bar:q2" }`), change them (`set` to a
|
|
331
|
+
value, `show` a hidden one, `highlight`, `pull` a slice out) and ride them:
|
|
332
|
+
a figure that leaps `onto` a bar is carried up as the bar grows. The edits are
|
|
333
|
+
tracks on the Chart element named `bar.q2.value`, `slice.a.pull` and so on,
|
|
334
|
+
which you can also key by hand. Charts show in the DOM and Canvas previews and
|
|
335
|
+
in GIF / WebP / MP4 export. See [Charts](acting.md#charts) for the same from
|
|
336
|
+
code.
|
|
337
|
+
|
|
313
338
|
### Selecting Elements
|
|
314
339
|
|
|
315
340
|
- **Click** an element to select it
|
|
@@ -1103,7 +1128,7 @@ The dialog shows the generated HTML/JavaScript code with a **Copy Code** button.
|
|
|
1103
1128
|
**Steps to embed:**
|
|
1104
1129
|
1. Build the player: `npm run build:player`
|
|
1105
1130
|
2. Copy `lib/player/tinyfly-player.iife.js` to your project (or load
|
|
1106
|
-
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
1131
|
+
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.100.0/cdn/tinyfly-player.iife.js`
|
|
1107
1132
|
instead; see [Deployment](DEPLOYMENT.md))
|
|
1108
1133
|
3. Copy the generated code into your HTML
|
|
1109
1134
|
4. Adjust the script `src` path if needed
|
|
@@ -1142,6 +1167,16 @@ The preview panel supports three rendering modes, switchable via the renderer se
|
|
|
1142
1167
|
|
|
1143
1168
|
All three renderers play the same animation β switch between them to verify cross-renderer compatibility.
|
|
1144
1169
|
|
|
1170
|
+
Every renderer is editable on stage. The DOM preview's elements take the
|
|
1171
|
+
pointer themselves; the Canvas and SVG previews draw into one surface, so a
|
|
1172
|
+
transparent hit layer over the drawing carries the same boxes, handlers and
|
|
1173
|
+
selection chrome (resize and rotation handles, path points), placed by the
|
|
1174
|
+
animation and the camera exactly as the drawing is. Clicking selects (the
|
|
1175
|
+
topmost element first), dragging moves, handles resize and rotate, and the
|
|
1176
|
+
grid, snapping, rulers, guides, the pen tool and camera panning work the
|
|
1177
|
+
same whichever preview is on. Characters, charts, props and 3D scenes, which
|
|
1178
|
+
only the Canvas preview draws fully, can be arranged there directly.
|
|
1179
|
+
|
|
1145
1180
|
### Onion skinning
|
|
1146
1181
|
|
|
1147
1182
|
In the **Canvas** renderer, click **π§
Onion** to show faint **ghost frames**
|
package/docs/examples.md
CHANGED
|
@@ -694,7 +694,7 @@ For simple website embedding without a build system.
|
|
|
694
694
|
</html>
|
|
695
695
|
```
|
|
696
696
|
|
|
697
|
-
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.
|
|
697
|
+
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.100.0/cdn/tinyfly-player.iife.js`.
|
|
698
698
|
|
|
699
699
|
---
|
|
700
700
|
|
package/docs/getting-started.md
CHANGED
|
@@ -185,7 +185,7 @@ with a GSAP-style call (durations are in seconds here):
|
|
|
185
185
|
```html
|
|
186
186
|
<div class="box" style="width:60px;height:60px;background:#4a9eff"></div>
|
|
187
187
|
|
|
188
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
188
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.100.0/cdn/tinyfly.iife.js"></script>
|
|
189
189
|
<script>
|
|
190
190
|
tinyfly.to('.box', { x: 200, duration: 1 })
|
|
191
191
|
</script>
|
package/docs/gsap-compat.md
CHANGED
|
@@ -74,7 +74,7 @@ Without a build step, the all-in-one bundle exposes the same functions on a
|
|
|
74
74
|
global β `tinyfly.to()`, `tinyfly.timeline()` and so on:
|
|
75
75
|
|
|
76
76
|
```html
|
|
77
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
77
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.100.0/cdn/tinyfly.iife.js"></script>
|
|
78
78
|
<script>
|
|
79
79
|
tinyfly.to('.box', { x: 200, duration: 1 })
|
|
80
80
|
</script>
|
package/docs/llm-guide.md
CHANGED
|
@@ -30,10 +30,16 @@ in `@algorisys/tinyfly/characters`.
|
|
|
30
30
|
|
|
31
31
|
## Props
|
|
32
32
|
|
|
33
|
-
For objects in a story (vehicles, trees, houses,
|
|
34
|
-
use the presets (`car()`, `tree()`, `
|
|
33
|
+
For objects in a story (vehicles, trees, houses, furniture, aircraft,
|
|
34
|
+
animals, birds), use the presets (`car()`, `tree()`, `chair()`, `door()`,
|
|
35
|
+
`wheelchair()`, `helicopter()`, `dog()`, `goat()`, `owl()`β¦) with
|
|
35
36
|
`propTarget` and `propScript`; the catalog lists each preset's actions,
|
|
36
|
-
controls and anchors, and `checkPropBeats` checks prop beats.
|
|
37
|
+
controls and anchors, and `checkPropBeats` checks prop beats. Furniture has
|
|
38
|
+
the places a figure uses it at as anchors (`seat`, `top`, `mattress`,
|
|
39
|
+
`handle`, `doorway`): aim beats at them rather than guessing a spot. For a
|
|
40
|
+
sky or a room behind everything use `scenery()` (or `scenePreset('park')`),
|
|
41
|
+
whose `hour`, `clouds`, `wind`, `rain` and `snow` are tracks, not a drawing
|
|
42
|
+
of your own. `style: 'stick'`
|
|
37
43
|
draws any prop as line art to go with stick figures. A bird's `lift` is in
|
|
38
44
|
metres: to perch it on a branch or a roof, work the height out from that
|
|
39
45
|
prop's anchor (`propAt(tree, frame, 'tree').anchor('branch')`). In a 3D
|
|
@@ -49,9 +55,14 @@ seated with `propRide3D` and spliced into its script with `spliceTracks`. See `d
|
|
|
49
55
|
|
|
50
56
|
A v2 character's appearance is plain options to `character()`, never drawing
|
|
51
57
|
code: `build` (`child`, `tall`, `short`β¦), `hair` (a style name, or
|
|
52
|
-
`{ style, color, length, β¦ }`), `facialHair`, `glasses`, `hat`, `ears: true
|
|
53
|
-
|
|
54
|
-
|
|
58
|
+
`{ style, color, length, β¦ }`), `facialHair`, `glasses`, `hat`, `ears: true`,
|
|
59
|
+
`face: { teeth, tongue }` (shown when the mouth opens), `feet` (`round`,
|
|
60
|
+
`flat`, `pointed`, `big`) and `outfit: { shirt, trousers, over: 'hoodie' |
|
|
61
|
+
'cardigan' | 'overalls' | 'sari' | 'apron' | 'labCoat', shoes: 'boots' }`.
|
|
62
|
+
`castMember('grandpa', 300)` gives a whole ready-made character to start
|
|
63
|
+
from. Age is hair, glasses and clothes, never a stoop; a `cane` in a hand or
|
|
64
|
+
a `wheelchair()` to ride (`RIDING_POSES.wheeling`) is an accessory any
|
|
65
|
+
character can have. Expressions come from `HUMAN_EXPRESSIONS`
|
|
55
66
|
and are pose fields, as are the face marks `blush`, `tears` and `sweat` (0β1),
|
|
56
67
|
so any face goes with any action or view. Hair and hats turn with the head:
|
|
57
68
|
don't draw a different hairstyle per view. Hanging hair swings on its own:
|
|
@@ -60,7 +71,9 @@ posing per frame, `hairFollow` once and `hairMotionAt(keys, t)` each frame)
|
|
|
60
71
|
rather than keying `hair.swing` by hand. Put things in hands with `holding`
|
|
61
72
|
(`{ right: 'mug' }`, `{ both: 'parcel' }`; the pose field `held.both` lets go),
|
|
62
73
|
and for two characters touching use `meetHands('handshake', a, b)` with the
|
|
63
|
-
two standing `meetingSpacing(β¦)` apart,
|
|
74
|
+
two standing `meetingSpacing(β¦)` apart, `embrace(a, b)` for a hug at
|
|
75
|
+
`embraceSpacing` and `helpUp(helper, sitter, progress)` for a help-up at
|
|
76
|
+
`helpUpSpacing`, never two separate clips. See
|
|
64
77
|
`docs/character-appearance.md`.
|
|
65
78
|
|
|
66
79
|
## Surfaces
|
package/docs/maps.md
CHANGED
|
@@ -14,8 +14,8 @@ On a page with no build step, load the maps add-on after the browser bundle; it
|
|
|
14
14
|
adds to the same `tinyfly` global:
|
|
15
15
|
|
|
16
16
|
```html
|
|
17
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
18
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
17
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.100.0/cdn/tinyfly.iife.js"></script>
|
|
18
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.100.0/cdn/tinyfly-maps.iife.js"></script>
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
It is a separate script because the offline world map it carries adds about
|
package/docs/props.md
CHANGED
|
@@ -107,14 +107,22 @@ one probably meant, and `propScript` throws on them.
|
|
|
107
107
|
| `car()`, `truck()`, `bus()`, `tractor()`, `cart()`, `trainCar()`, `bike()`, `motorbike()` | `drive` (`to`), `brake` (`to`, a skid with locked wheels), `bump`, `honk`, `door` (`open`), `lights` (`on`) β doors and lights where it has them |
|
|
108
108
|
| `tree()` | `sway` (`wind`, `for`), `shake`, `shedLeaves` |
|
|
109
109
|
| `house()` | `door` (`open`), `lights` (`on`), `smoke` (`for`, runs in the background), `shake` |
|
|
110
|
+
| `chair()` | `tip` (`for`: back on its rear legs, then settles), `fall` |
|
|
111
|
+
| `desk()` | `drawer` (`open`) |
|
|
112
|
+
| `bed()` | `bounce` (`for`: the mattress gives and springs back) |
|
|
113
|
+
| `door()` | `open` (`open`, `for`), `slam`, `knock` (`for`) |
|
|
114
|
+
| `wheelchair()` | `roll` (`to`; the wheels turn the distance), `brake` (`to`, wheels locked), `wheelie` (`for`) |
|
|
110
115
|
| `helicopter()` | `takeOff` (`height`), `fly` (`to`, `height`), `hover`, `land` |
|
|
111
116
|
| `airplane()` | `takeOff` (`to`, `height`), `fly` (`to`, `height`), `loop`, `land` (`to`) |
|
|
112
117
|
| `horse()` | `walk`, `trot`, `canter`, `gallop` (`to`), `rear`, `buck`, `neigh`, `graze`, `sit`, `lie`, `jump`, `nod`, `swish` |
|
|
113
118
|
| `dog()` | `walk`, `trot`, `run` (`to`), `bark`, `wag`, `sniff`, `sit`, `lie`, `jump`, `nod`, `swish` |
|
|
114
119
|
| `cat()` | `walk`, `trot`, `run` (`to`), `meow`, `arch`, `pounce` (`to`), `sit`, `lie`, `jump`, `nod`, `swish` |
|
|
115
120
|
| `cow()` | `walk`, `trot` (`to`), `moo`, `graze`, `sit`, `lie`, `jump`, `nod`, `swish` |
|
|
121
|
+
| `goat()` | `walk`, `trot`, `gallop` (`to`), `bleat`, `graze`, `sit`, `lie`, `jump`, `nod`, `swish` |
|
|
122
|
+
| `rabbit()`, `squirrel()` | `walk`, `gallop` (`to`: a hop, a scamper), `squeak` / `chatter`, `graze` (nibble), `sit`, `lie`, `jump`, `nod`, `swish` |
|
|
116
123
|
| `songbird()`, `crow()` | `hop`, `walk` (`to`), `peck` (`for`), `flap` (`for`), `fly` (`to`, `height`), `glide` (`to`, `height`), `land` (`height`, `to`), `tweet` / `caw` |
|
|
117
124
|
| `chicken()` | `walk` (`to`), `peck`, `flap`, `flutter`, `cluck` (it cannot fly) |
|
|
125
|
+
| `pigeon()`, `duck()`, `owl()`, `parrot()` | As the songbird: `hop`, `walk`, `peck`, `flap`, `fly`, `glide`, `land`, and `coo` / `quack` / `hoot` / `squawk` |
|
|
118
126
|
|
|
119
127
|
**Line art.** `propTarget({ β¦, style: 'stick' })` (or `drawSolvedProp(β¦, { style: 'stick' })`)
|
|
120
128
|
draws a prop as line art to go with stick figures: tubes (legs, necks, tails,
|
|
@@ -141,7 +149,8 @@ neck stretches down to reach), and it walks with its head bobbing or hops.
|
|
|
141
149
|
air) and flies to `height` metres; `glide` holds the wings out still and sinks
|
|
142
150
|
gently toward `height` on the way to `to` (from the ground it flies the first
|
|
143
151
|
stretch); `land` comes down to the ground or to a
|
|
144
|
-
perch (`height`)
|
|
152
|
+
perch (`height`), and landing above the ground its toes curl round the perch
|
|
153
|
+
(`grip`, cleared as it takes off). Perch it with anchors:
|
|
145
154
|
|
|
146
155
|
```js
|
|
147
156
|
const branch = propAt(treeTarget, { time: 0 }, 'tree').anchor('branch')
|
|
@@ -165,6 +174,26 @@ Make your own from the family generators: `vehicle(spec)` takes:
|
|
|
165
174
|
|
|
166
175
|
`tree(spec)` and `house(spec)` take sizes and colours.
|
|
167
176
|
|
|
177
|
+
**Furniture.** `chair()`, `desk()`, `bed()` and `door()` stand on the ground
|
|
178
|
+
facing the viewer, and their places are anchors a figure uses them at: a
|
|
179
|
+
chair's `seat` (ride it with `propRide({ anchor: 'seat' })`, a `seated` pose
|
|
180
|
+
and `offset: { y: seatHeight(height) }`), `back` and `front`; a desk's `top`,
|
|
181
|
+
`edge`, `drawer` and the `chair` spot in front; a bed's `mattress`, `pillow`,
|
|
182
|
+
`foot` and `side`; a door's `handle`, `doorway`, `front` and `beyond` (a figure
|
|
183
|
+
goes through from `front` to `beyond`, and the door is drawn over it until it
|
|
184
|
+
opens). Each takes sizes and colours (`chair({ seatHeight: 0.5 })`, `door({
|
|
185
|
+
hinge: 'right' })`). As surfaces (`propSurface`), their controls are edits a
|
|
186
|
+
beat makes: `set` or `switch` `control:open`, `control:drawer`, `control:tip`.
|
|
187
|
+
|
|
188
|
+
A `wheelchair()` is furniture that moves: a seat and back on a frame, two big
|
|
189
|
+
rimmed wheels, castors and footrests. It `roll`s to a place with its wheels
|
|
190
|
+
turning exactly the distance (in 3D, its `roll` move does the same in
|
|
191
|
+
metres), `brake`s with them locked, and tips back for a `wheelie`. Any
|
|
192
|
+
character rides its `seat` in the `wheeling` pose (`RIDING_POSES.wheeling`:
|
|
193
|
+
sitting up, hands down at the rims), and a pusher stands at `handles` in the
|
|
194
|
+
`push` pose. It is an accessory, not an age or a build: who uses it is the
|
|
195
|
+
story's choice, like a `cane` in a hand.
|
|
196
|
+
|
|
168
197
|
## Figures with props
|
|
169
198
|
|
|
170
199
|
- **Riding.** `propRide({ prop, propId, propTracks, anchor: 'seat', figure, figureId, start, end, offset })`
|
|
@@ -183,6 +212,37 @@ Make your own from the family generators: `vehicle(spec)` takes:
|
|
|
183
212
|
See the gallery cards **Road Trip**, **Windy Day**, **Helicopter**,
|
|
184
213
|
**Traffic**, **Horse & Cart**, **Farmyard**, **Birds** and **3D Scene: Village**.
|
|
185
214
|
|
|
215
|
+
## Scenery
|
|
216
|
+
|
|
217
|
+
`scenery(options)` is the world behind the figures: a canvas target that draws
|
|
218
|
+
a sky (the sun and moon on their arcs, stars at night, clouds drifting on the
|
|
219
|
+
wind, rain that slants with it, snow that drifts, hills or a city on the
|
|
220
|
+
horizon, the ground) or a room (a wall, a floor and a window on that sky). Its
|
|
221
|
+
values are tracks, so a day passes and weather comes and goes as keyframes,
|
|
222
|
+
and every frame is drawn from its time alone:
|
|
223
|
+
|
|
224
|
+
```js
|
|
225
|
+
const sky = scenery({ x: 0, y: 0, width: 720, height: 400, hour: 9, clouds: 0.4, horizon: 'hills' })
|
|
226
|
+
sky.set('hour', { at: 0, value: 20, duration: 12000 }) // dawn to night
|
|
227
|
+
sky.set('wind', { at: 3000, value: 0.8, duration: 1000 })
|
|
228
|
+
sky.set('rain', { at: 5000, value: 0.8, duration: 1500 })
|
|
229
|
+
const tracks = sky.tracks('sky') // hour, wind, rain keys on 'sky'
|
|
230
|
+
sky.anchor('sun', 4000) // where the sun is then
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
`hour` runs 0β24, `clouds`, `rain` and `snow` 0β1, `wind` β1 (from the right)
|
|
234
|
+
to 1 (from the left). The same wind streams a character's hair:
|
|
235
|
+
`hairFollowTracks(target, tracks, who, { wind })`. `kind: 'room'` draws a wall
|
|
236
|
+
and a floor with a `window` on the sky; `horizon` is `hills`, `city` (lit
|
|
237
|
+
windows at night) or `flat`; `colors` recolour any of it.
|
|
238
|
+
|
|
239
|
+
`scenePreset(name, { width, height })` lays out a scene as plain data (the
|
|
240
|
+
scenery and where the props stand) and `buildScene` builds it into targets:
|
|
241
|
+
`park` (a late-morning sky over hills, two trees and a bench), `street` (the end
|
|
242
|
+
of the afternoon against the city: houses, a car, a tree), `office` (a room
|
|
243
|
+
with a desk, a chair and a door) and `home` (a room at night with a bed, a
|
|
244
|
+
chair and a door). The Park Day card plays a day over the park.
|
|
245
|
+
|
|
186
246
|
## In 3D scenes
|
|
187
247
|
|
|
188
248
|
Props stand in `@algorisys/tinyfly/scene-3d` scenes too:
|
package/docs/teaching.md
CHANGED
|
@@ -25,7 +25,7 @@ path for all of that:
|
|
|
25
25
|
</figure>
|
|
26
26
|
|
|
27
27
|
<!-- once, anywhere on the page (a site-wide footer is fine) -->
|
|
28
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
28
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.100.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
Every `[data-tinyfly-embed]` mounts when the page is ready, with no per-post
|