@algorisys/tinyfly 0.107.1 → 0.109.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 -12
- package/docs/character-appearance.md +148 -0
- package/docs/cricket.md +127 -0
- package/docs/editor-guide.md +1 -1
- 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 +58 -0
- package/docs/maps.md +2 -2
- package/docs/teaching.md +1 -1
- package/lib/addons/characters.js +4674 -8156
- package/lib/addons/cricket-camera-BWByoNgz.js +4205 -0
- package/lib/addons/scene-3d.js +436 -540
- package/lib/addons/shots-DR_ViiAC.js +125 -0
- package/lib/addons/sports.js +390 -0
- package/lib/browser/tinyfly.iife.js +14 -14
- package/lib/browser/tinyfly.js +9334 -8322
- package/lib/browser/tinyfly.umd.js +14 -14
- package/lib/types/browser/index.d.ts +1 -0
- package/lib/types/characters/body/organic-body.d.ts +56 -0
- package/lib/types/characters/body/organic-draw.d.ts +5 -0
- package/lib/types/characters/body/organic-geometry.d.ts +25 -0
- package/lib/types/characters/capabilities.d.ts +14 -0
- package/lib/types/characters/character.d.ts +15 -2
- package/lib/types/characters/hands/draw-cartoon-hand.d.ts +4 -0
- package/lib/types/characters/head/face.d.ts +6 -4
- package/lib/types/characters/head/facial-hair.d.ts +2 -0
- package/lib/types/characters/head/glasses.d.ts +2 -0
- package/lib/types/characters/head/head-look.d.ts +4 -2
- package/lib/types/characters/head/head-shape.d.ts +4 -0
- package/lib/types/characters/index.d.ts +5 -0
- package/lib/types/characters/look/pen.d.ts +1 -0
- package/lib/types/characters/look/skin-shading.d.ts +4 -0
- package/lib/types/characters/rig/skeleton.d.ts +2 -0
- package/lib/types/characters/soft-cartoon-cast.d.ts +166 -0
- package/lib/types/characters/wardrobe/basic-outfit.d.ts +5 -1
- package/lib/types/characters/wardrobe/leaf-outfit.d.ts +18 -0
- package/lib/types/characters/wardrobe/outfit-preset.d.ts +6 -0
- package/lib/types/sports/ball-flight.d.ts +22 -0
- package/lib/types/sports/cricket/cricket-action.d.ts +7 -0
- package/lib/types/sports/cricket/cricket-camera.d.ts +13 -0
- package/lib/types/sports/cricket/cricket-field.d.ts +13 -0
- package/lib/types/sports/cricket/cricket-motion.d.ts +36 -0
- package/lib/types/sports/cricket/cricket-types.d.ts +84 -0
- package/lib/types/sports/cricket/index.d.ts +5 -0
- package/lib/types/sports/index.d.ts +3 -0
- package/llms-full.txt +377 -9
- package/llms.txt +30 -29
- package/package.json +5 -1
- package/skills/tinyfly/SKILL.md +49 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type Character } from '../../characters/character';
|
|
2
|
+
import { HAND_SHAPES } from '../../characters/hands/hand-rig';
|
|
3
|
+
import type { Pose } from '../../characters/rig/body-plan';
|
|
4
|
+
import { type Quat, type Vec3 } from '../../engine/math';
|
|
5
|
+
import type { CharacterObject3D, Scene3D } from '../../scene-3d/scene-types';
|
|
6
|
+
export interface CricketActor {
|
|
7
|
+
object: CharacterObject3D;
|
|
8
|
+
who: Character;
|
|
9
|
+
}
|
|
10
|
+
export interface BatFrame {
|
|
11
|
+
grip: Vec3;
|
|
12
|
+
axis: Vec3;
|
|
13
|
+
scale: number;
|
|
14
|
+
}
|
|
15
|
+
export interface CricketSample {
|
|
16
|
+
position: Vec3;
|
|
17
|
+
pose: Pose;
|
|
18
|
+
bat?: BatFrame;
|
|
19
|
+
}
|
|
20
|
+
export declare const progress: (time: number, start: number, end: number) => number;
|
|
21
|
+
export declare const smooth: (t: number) => number;
|
|
22
|
+
export declare const add: (a: Vec3, b: Vec3) => Vec3;
|
|
23
|
+
export declare const scale: (a: Vec3, b: number) => Vec3;
|
|
24
|
+
export declare function cricketActor(scene: Scene3D, id: string): CricketActor;
|
|
25
|
+
export declare function restSample(actor: CricketActor): CricketSample;
|
|
26
|
+
/** Actual native wrist/elbow/leg points in world space, including grounding and body yaw. */
|
|
27
|
+
export declare function cricketJoint(actor: CricketActor, sample: CricketSample, chain: string, index: number): Vec3;
|
|
28
|
+
export declare function cricketPalm(actor: CricketActor, sample: CricketSample, side: 'left' | 'right'): Vec3;
|
|
29
|
+
/** Solve to the rendered palm rather than snapping an unattached prop to a desired hand point. */
|
|
30
|
+
export declare function cricketReach(actor: CricketActor, sample: CricketSample, side: 'left' | 'right', target: Vec3, shape?: keyof typeof HAND_SHAPES): CricketSample;
|
|
31
|
+
export declare function gripBat(actor: CricketActor, sample: CricketSample, target: Vec3, axis: Vec3): CricketSample;
|
|
32
|
+
export declare function batSweetSpot(bat: BatFrame): Vec3;
|
|
33
|
+
/** Rotation from a mesh's +y axis to a world direction. Written as slerp keyframe data. */
|
|
34
|
+
export declare function alignCricketEquipment(direction: Vec3): Quat;
|
|
35
|
+
export declare function blendPose(a: Pose, b: Pose, t: number): Pose;
|
|
36
|
+
export declare function poseSequence(time: number, keys: Array<[number, Pose]>): Pose;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { TimelineDefinition } from '../../engine/types';
|
|
2
|
+
import type { Vec3 } from '../../engine/math';
|
|
3
|
+
import type { CharacterObject3D, Scene3D } from '../../scene-3d/scene-types';
|
|
4
|
+
import type { CharacterOptions } from '../../characters/character';
|
|
5
|
+
import type { SoftCartoonName } from '../../characters/soft-cartoon-cast';
|
|
6
|
+
export type CricketFormat = 'test' | 'odi' | 't20';
|
|
7
|
+
export type CricketRole = 'batter' | 'bowler' | 'keeper' | 'fielder' | 'umpire';
|
|
8
|
+
export type CricketCast = 'adults' | 'children' | 'mixed';
|
|
9
|
+
export type CricketAction = 'bowling' | 'spin' | 'batting' | 'defend' | 'running' | 'four' | 'six' | 'catch' | 'fielding' | 'throw' | 'bowled' | 'lbw' | 'stumping' | 'run-out' | 'no-ball' | 'wide';
|
|
10
|
+
export interface CricketFormatInfo {
|
|
11
|
+
name: string;
|
|
12
|
+
inningsPerSide: number;
|
|
13
|
+
oversPerInnings: number | null;
|
|
14
|
+
ballsPerOver: number;
|
|
15
|
+
freeHitAfterNoBall: boolean;
|
|
16
|
+
summary: string;
|
|
17
|
+
}
|
|
18
|
+
/** Basic international format facts, not a full set of competition playing conditions. */
|
|
19
|
+
export declare const CRICKET_FORMATS: Readonly<Record<CricketFormat, Readonly<CricketFormatInfo>>>;
|
|
20
|
+
export interface CricketPlayerOptions {
|
|
21
|
+
id: string;
|
|
22
|
+
role: CricketRole;
|
|
23
|
+
preset?: SoftCartoonName;
|
|
24
|
+
format?: CricketFormat;
|
|
25
|
+
height?: number;
|
|
26
|
+
position?: Vec3;
|
|
27
|
+
color?: string;
|
|
28
|
+
/** Optional headwear; bare heads keep expressive faces clear in tutorial close-ups. */
|
|
29
|
+
headwear?: 'none' | 'cap' | 'sun-hat';
|
|
30
|
+
/** JSON appearance settings; canvas hooks and custom rig callbacks are deliberately excluded. */
|
|
31
|
+
appearance?: Pick<CharacterOptions, 'skin' | 'ink' | 'hair' | 'face' | 'body' | 'headSize' | 'shoulderWidth' | 'hipWidth' | 'armLength' | 'legLength' | 'handSize'>;
|
|
32
|
+
}
|
|
33
|
+
export interface CricketFieldOptions {
|
|
34
|
+
id?: string;
|
|
35
|
+
format?: CricketFormat;
|
|
36
|
+
cast?: CricketCast;
|
|
37
|
+
/** Circular illustrative boundary in metres, default 64; venues choose their own boundaries. */
|
|
38
|
+
boundaryRadius?: number;
|
|
39
|
+
battingColor?: string;
|
|
40
|
+
fieldingColor?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface CricketField {
|
|
43
|
+
scene: Scene3D;
|
|
44
|
+
format: CricketFormat;
|
|
45
|
+
boundaryRadius: number;
|
|
46
|
+
landmarks: Record<string, Vec3>;
|
|
47
|
+
}
|
|
48
|
+
export interface CricketEvent {
|
|
49
|
+
id: string;
|
|
50
|
+
time: number;
|
|
51
|
+
kind: 'setup' | 'release' | 'bounce' | 'contact' | 'collect' | 'throw' | 'wicket' | 'boundary' | 'signal' | 'result';
|
|
52
|
+
label: string;
|
|
53
|
+
caption: string;
|
|
54
|
+
}
|
|
55
|
+
export interface CricketResult {
|
|
56
|
+
runs: number;
|
|
57
|
+
extras: number;
|
|
58
|
+
wickets: number;
|
|
59
|
+
legalBall: boolean;
|
|
60
|
+
freeHitNext: boolean;
|
|
61
|
+
dismissal?: 'caught' | 'bowled' | 'lbw' | 'stumped' | 'run-out';
|
|
62
|
+
}
|
|
63
|
+
export interface CricketActionOptions {
|
|
64
|
+
action?: CricketAction;
|
|
65
|
+
/** Complete clip length, default 6000 ms, 4000..60000. */
|
|
66
|
+
duration?: number;
|
|
67
|
+
every?: number;
|
|
68
|
+
}
|
|
69
|
+
export interface CricketActionResult {
|
|
70
|
+
action: CricketAction;
|
|
71
|
+
duration: number;
|
|
72
|
+
timeline: TimelineDefinition;
|
|
73
|
+
events: CricketEvent[];
|
|
74
|
+
/** Authored example outcome; no automatic scoring or umpiring is inferred from geometry. */
|
|
75
|
+
result: CricketResult;
|
|
76
|
+
}
|
|
77
|
+
export interface CricketClip extends CricketField, CricketActionResult {
|
|
78
|
+
}
|
|
79
|
+
export type CricketPlayer = CharacterObject3D;
|
|
80
|
+
export declare const CRICKET_ACTIONS: Readonly<Record<CricketAction, Readonly<{
|
|
81
|
+
name: string;
|
|
82
|
+
summary: string;
|
|
83
|
+
}>>>;
|
|
84
|
+
export declare function cricketChoice<T extends string>(choices: Readonly<Record<T, unknown>>, value: T, name: string): T;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { cricketPlayer, cricketField, CRICKET_PITCH } from './cricket-field';
|
|
2
|
+
export { cricketAction, cricketClip, cricketEventAt } from './cricket-action';
|
|
3
|
+
export { cricketCameraTracks, CRICKET_VIEWS, CRICKET_CAMERA_ANGLES, type CricketView, type CricketCameraOptions } from './cricket-camera';
|
|
4
|
+
export { CRICKET_FORMATS, CRICKET_ACTIONS } from './cricket-types';
|
|
5
|
+
export type { CricketFormat, CricketRole, CricketCast, CricketAction, CricketFormatInfo, CricketPlayerOptions, CricketFieldOptions, CricketField, CricketEvent, CricketResult, CricketActionOptions, CricketActionResult, CricketClip, CricketPlayer } from './cricket-types';
|
package/llms-full.txt
CHANGED
|
@@ -15,6 +15,138 @@ Key facts:
|
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
|
18
|
+
<!-- docs/cricket.md -->
|
|
19
|
+
|
|
20
|
+
# Cricket stories
|
|
21
|
+
|
|
22
|
+
Build a cricket scene and a play as JSON with `@algorisys/tinyfly/sports`.
|
|
23
|
+
The same data runs in a browser, Worker or Node. Players use tinyfly's
|
|
24
|
+
existing organic adult and child rig. Try the [interactive cricket example](https://tinyfly.app/examples/live-cricket-story)
|
|
25
|
+
or its [full-page view](https://tinyfly.app/examples/live-cricket-story/full).
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { Timeline } from '@algorisys/tinyfly'
|
|
29
|
+
import { cricketClip, cricketCameraTracks, cricketEventAt } from '@algorisys/tinyfly/sports'
|
|
30
|
+
import { characterObjects } from '@algorisys/tinyfly/characters'
|
|
31
|
+
import { loadScene3D, drawScene3D } from '@algorisys/tinyfly/scene-3d'
|
|
32
|
+
|
|
33
|
+
const clip = cricketClip({ format: 't20', action: 'stumping', cast: 'mixed' })
|
|
34
|
+
const tracks = [...clip.timeline.tracks, ...cricketCameraTracks(clip, { view: 'keeper' })]
|
|
35
|
+
const timeline = new Timeline({ ...clip.timeline, tracks })
|
|
36
|
+
const scene = loadScene3D(clip.scene, { kinds: [characterObjects] })
|
|
37
|
+
// Your explicit clock supplies time in milliseconds.
|
|
38
|
+
function draw(ctx, time) {
|
|
39
|
+
drawScene3D(ctx, scene, timeline.getStateAtTime(time).values,
|
|
40
|
+
{ width: 1280, height: 720, time })
|
|
41
|
+
const caption = cricketEventAt(clip.events, time)?.caption
|
|
42
|
+
return caption
|
|
43
|
+
}
|
|
44
|
+
const json = JSON.stringify({ ...clip, timeline: { ...clip.timeline, tracks } })
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
With script tags, load `tinyfly.iife.js` and the scene-3d add-on. Sports builders
|
|
48
|
+
and characters are available on `tinyfly`; scene rendering uses the add-on.
|
|
49
|
+
See [getting started](getting-started.md) for the versioned CDN URLs.
|
|
50
|
+
|
|
51
|
+
## Builders
|
|
52
|
+
|
|
53
|
+
| API | Result |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `cricketPlayer({ id, role, preset?, format?, height?, position?, color?, headwear?, appearance? })` | An owned JSON `character` scene object. Roles: batter, bowler, keeper, fielder, umpire. Presets include youngMan, youngWoman, childBoy, childGirl. |
|
|
56
|
+
| `cricketField({ id?, format?, cast?, boundaryRadius?, battingColor?, fieldingColor? })` | `scene`, `format`, `boundaryRadius`, `landmarks`. A 20.12 × 3.05 metre pitch, standard creases, wickets/bails, two bats, ball, boundary, eleven fielding players, two batters and two umpires. |
|
|
57
|
+
| `cricketAction(field, { action?, duration?, every? })` | A JSON timeline, timed events/captions and declared example result. Does not modify the field. |
|
|
58
|
+
| `cricketClip(options)` | Combines field and action; default T20, adult cast, pace bowling, 6000 ms. |
|
|
59
|
+
| `cricketCameraTracks(clip, { view?, yaw?, every? })` | Ordinary scene camera tracks. Merge these with the action tracks. |
|
|
60
|
+
| `cricketEventAt(events, time)` | Most recent event at that time, including when seeking backward. |
|
|
61
|
+
| `ballFlightPoint(options, time)`, `ballFlightTracks(options)` | Shared sampled arcs for other sports too. `from`, `to`, `arc`, `curve`, `start`, `end`, `target`; exact endpoints. |
|
|
62
|
+
|
|
63
|
+
Units are metres, milliseconds and degrees. `cast` is `adults`, `children` or
|
|
64
|
+
`mixed`; `format` is `test`, `odi` or `t20`. `boundaryRadius` defaults to 64 m
|
|
65
|
+
and accepts 24–250 m. A boundary is venue dependent. Sampling defaults to 40 ms,
|
|
66
|
+
accepts 16–1000 ms and always includes play contact events. Durations accept
|
|
67
|
+
4000–60000 ms; changing duration scales the whole play. Player height accepts
|
|
68
|
+
0.5–3 m. Bare heads are the default; optional `headwear` is `none`, `cap` or
|
|
69
|
+
`sun-hat`. Appearance is JSON data, without canvas hooks or rig callbacks.
|
|
70
|
+
|
|
71
|
+
The standard action builder expects the named actors/equipment from
|
|
72
|
+
`cricketField`; required actors must be unparented with no object rotation or
|
|
73
|
+
scale. It owns poses and paths for that layout. Customize appearance and
|
|
74
|
+
uniforms before compiling; author your own scene tracks for a different layout.
|
|
75
|
+
|
|
76
|
+
## Plays and cameras
|
|
77
|
+
|
|
78
|
+
`CRICKET_ACTIONS` contains sixteen plays:
|
|
79
|
+
|
|
80
|
+
- `bowling`, `spin`: run-up, delivery, bounce and keeper collection.
|
|
81
|
+
- `batting`, `defend`: drive or block with two hands gripping the bat.
|
|
82
|
+
- `running`: batters change ends for one illustrated run.
|
|
83
|
+
- `four`, `six`: grounded boundary or boundary crossed in the air, with signals.
|
|
84
|
+
- `catch`, `fielding`, `throw`: aerial catch, ground collection or return throw.
|
|
85
|
+
- `bowled`, `lbw`, `stumping`, `run-out`: distinct authored dismissal examples.
|
|
86
|
+
- `no-ball`, `wide`: extra, umpire signal and an uncounted delivery.
|
|
87
|
+
|
|
88
|
+
The ball releases from a rendered palm, meets the blade at contact, and follows
|
|
89
|
+
the collecting hand. Bails move after the relevant wicket break. Bats scale
|
|
90
|
+
with child proportions. Events carry `id`, `time`, `kind`, `label`, `caption`;
|
|
91
|
+
the timeline also contains matching markers and English captions.
|
|
92
|
+
Drive and ground-fielding plays use distinct collection positions, with the
|
|
93
|
+
ball and fielder keyed to the same palm contact.
|
|
94
|
+
Defensive blocks retain their downward two-hand bat pose and emit the `contact`
|
|
95
|
+
event with the “Bat contact” label. Pace, spin, no-ball and stumping deliveries
|
|
96
|
+
pass outside the off stump on the side away from the batter, allowing for the
|
|
97
|
+
displayed ball and stump radii before collection. Bowled keeps its intentional
|
|
98
|
+
wicket collision; stumping keeps the later hand-held wicket break.
|
|
99
|
+
|
|
100
|
+
`CRICKET_VIEWS` offers `pitch`, `batter`, `bowler`, `keeper`, `field`, `overhead`,
|
|
101
|
+
`orbit` and `follow-ball`. `yaw` chooses any azimuth; `orbit` adds a complete
|
|
102
|
+
360° revolution over the play. `CRICKET_CAMERA_ANGLES` provides suggested
|
|
103
|
+
starting angles. Equivalent azimuths such as 0° and 360° use identical geometry.
|
|
104
|
+
The field camera's clipping range scales with the boundary radius so wide views
|
|
105
|
+
include the full supported ground. Following the ball samples only its three
|
|
106
|
+
position channels with forward keyframe cursors, using the requested camera
|
|
107
|
+
spacing without evaluating actor tracks.
|
|
108
|
+
|
|
109
|
+
Development full-page previews load the local browser API and scene add-ons;
|
|
110
|
+
production previews and copied HTML retain the versioned CDN bundles.
|
|
111
|
+
|
|
112
|
+
## Teaching scope
|
|
113
|
+
|
|
114
|
+
These are authored visual demonstrations. Arcs, the enlarged ball, timings,
|
|
115
|
+
field placements and results are illustrative. The API does not infer a
|
|
116
|
+
cricket decision from collisions, enforce every law, simulate ball physics,
|
|
117
|
+
manage an innings or supply lesson navigation/quizzes. `result` declares
|
|
118
|
+
`runs`, `extras`, `wickets`, `legalBall`, `freeHitNext` and optional `dismissal`.
|
|
119
|
+
Use it with your own tutorial, narration, scoring or lesson system.
|
|
120
|
+
|
|
121
|
+
`CRICKET_FORMATS` records basic Test, ODI and T20 differences. Test has two
|
|
122
|
+
innings per side and no innings over limit; ODI/T20 have one innings per side
|
|
123
|
+
and maximum 50/20 overs respectively. See the [ICC format overview](https://www.icc-cricket.com/about/cricket/game-formats/the-three-formats).
|
|
124
|
+
No-balls and wides each add one extra and do not count as legal over balls.
|
|
125
|
+
The stumping example uses a legal delivery and a batter outside their ground,
|
|
126
|
+
without an attempted run. The LBW caption explicitly leaves a full decision's
|
|
127
|
+
pitching, impact and bat-contact checks to the author. Consult the
|
|
128
|
+
[MCC Laws, 2026 edition](https://www.lords.org/getmedia/a4ef9f77-2a25-4f5b-a286-4601f08e6334/Laws-of-Cricket-2017-Code-4th-Edition-(2026)_5.pdf).
|
|
129
|
+
ODI/T20 no-balls lead to a free hit on the next legitimate delivery; Test
|
|
130
|
+
does not add this automatically. Competition rules and effective dates matter:
|
|
131
|
+
see [ICC playing conditions](https://www.icc-cricket.com/about/cricket/rules-and-regulations/playing-conditions)
|
|
132
|
+
and the [October 2026 changes](https://www.icc-cricket.com/news/key-changes-across-formats-with-new-icc-playing-conditions).
|
|
133
|
+
|
|
134
|
+
## Headless video
|
|
135
|
+
|
|
136
|
+
After `npm run build:libs`:
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
node bin/tinyfly.mjs video examples/headless-video/cricket-story.mjs --stills /tmp/cricket-story
|
|
140
|
+
node bin/tinyfly.mjs video examples/headless-video/cricket-story.mjs -o /tmp/cricket-story.mp4
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
The example consumes the same public clip, camera and scene APIs. JSON download
|
|
144
|
+
in the interactive example includes the selected camera tracks, ready to sample
|
|
145
|
+
again after parsing. Other sports can reuse `ballFlightTracks`, character rigs
|
|
146
|
+
and scene cameras; cricket-specific motion remains in the sports add-on.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
18
150
|
<!-- docs/getting-started.md -->
|
|
19
151
|
|
|
20
152
|
# Getting Started with tinyfly
|
|
@@ -204,7 +336,7 @@ with a GSAP-style call (durations are in seconds here):
|
|
|
204
336
|
```html
|
|
205
337
|
<div class="box" style="width:60px;height:60px;background:#4a9eff"></div>
|
|
206
338
|
|
|
207
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
339
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.109.0/cdn/tinyfly.iife.js"></script>
|
|
208
340
|
<script>
|
|
209
341
|
tinyfly.to('.box', { x: 200, duration: 1 })
|
|
210
342
|
</script>
|
|
@@ -412,7 +544,7 @@ Without a build step, the all-in-one bundle exposes the same functions on a
|
|
|
412
544
|
global — `tinyfly.to()`, `tinyfly.timeline()` and so on:
|
|
413
545
|
|
|
414
546
|
```html
|
|
415
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
547
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.109.0/cdn/tinyfly.iife.js"></script>
|
|
416
548
|
<script>
|
|
417
549
|
tinyfly.to('.box', { x: 200, duration: 1 })
|
|
418
550
|
</script>
|
|
@@ -2327,7 +2459,7 @@ For simple website embedding without a build system.
|
|
|
2327
2459
|
</html>
|
|
2328
2460
|
```
|
|
2329
2461
|
|
|
2330
|
-
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.
|
|
2462
|
+
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.109.0/cdn/tinyfly-player.iife.js`.
|
|
2331
2463
|
|
|
2332
2464
|
---
|
|
2333
2465
|
|
|
@@ -6680,7 +6812,7 @@ The dialog shows the generated HTML/JavaScript code with a **Copy Code** button.
|
|
|
6680
6812
|
**Steps to embed:**
|
|
6681
6813
|
1. Build the player: `npm run build:player`
|
|
6682
6814
|
2. Copy `lib/player/tinyfly-player.iife.js` to your project (or load
|
|
6683
|
-
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
6815
|
+
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.109.0/cdn/tinyfly-player.iife.js`
|
|
6684
6816
|
instead; see [Deployment](DEPLOYMENT.md))
|
|
6685
6817
|
3. Copy the generated code into your HTML
|
|
6686
6818
|
4. Adjust the script `src` path if needed
|
|
@@ -7921,6 +8053,58 @@ bakes. See `docs/dance.md`.
|
|
|
7921
8053
|
|
|
7922
8054
|
## Characters with a look
|
|
7923
8055
|
|
|
8056
|
+
For cricket tutorials, import `cricketClip`, `cricketCameraTracks` and
|
|
8057
|
+
`cricketEventAt` from `@algorisys/tinyfly/sports`. The clip is an owned scene,
|
|
8058
|
+
JSON timeline, timed captions and declared result. Choose `test | odi | t20`,
|
|
8059
|
+
`adults | children | mixed`, and a play from `CRICKET_ACTIONS`. Merge camera
|
|
8060
|
+
tracks with action tracks; render with scene-3d plus `[characterObjects]`.
|
|
8061
|
+
The UI is a consumer of these APIs. `orbit` covers the full ground in 360°;
|
|
8062
|
+
`follow-ball` keys against the same ball tracks. Contacts are sampled exactly,
|
|
8063
|
+
including two-hand bat grip, release, catch and wicket break. These are authored
|
|
8064
|
+
demonstrations, not collision-based umpiring or an innings simulator. Do not
|
|
8065
|
+
infer new outcomes from the illustrative arcs. See `docs/cricket.md` and
|
|
8066
|
+
`examples/headless-video/cricket-story.mjs`; `/examples/live-cricket-story`
|
|
8067
|
+
has event seeking and downloadable scene/action/camera JSON.
|
|
8068
|
+
Wide cameras support the full 24–250 m boundary range; equivalent yaw angles
|
|
8069
|
+
use identical geometry. Ball-follow cameras sample only ball position channels.
|
|
8070
|
+
Render the headless example with `tinyfly video <scene.mjs> -o <output.mp4>`.
|
|
8071
|
+
Preserve the defensive block's two-hand blade contact and `contact` event.
|
|
8072
|
+
Keeper-bound pace/spin/no-ball/stumping paths clear the off stump with the
|
|
8073
|
+
displayed ball radius included, before palm collection. Keep bowled contact
|
|
8074
|
+
and the later stumping wicket break intentional when editing these paths.
|
|
8075
|
+
|
|
8076
|
+
For original soft cartoon story characters, opt into `figure: 'organic'`.
|
|
8077
|
+
Its default `face.projection: 'volume'` moves eyes/mouth around the head and
|
|
8078
|
+
lets hair occlude them, with a flatter profile facial plane and a nose above
|
|
8079
|
+
the mouth; classic `cartoon` projection remains available. Foreground organic
|
|
8080
|
+
arms/hands draw together over lower garments, preserving the wrist at the waist.
|
|
8081
|
+
`body` owns JSON half-width profiles (`torso`, `arm`, `leg`, `neck`): increasing
|
|
8082
|
+
arrays of `{ at: 0..1, width: fractionOfHeight }` spanning 0 to 1. Set `skin`
|
|
8083
|
+
once for exposed body, head and hands; `body.fill` overrides it.
|
|
8084
|
+
Use `body.fill: 'none'` for outline-only exposed skin, including both hand
|
|
8085
|
+
variants in every look. In 3D, only foreground arms use garment depths for
|
|
8086
|
+
painter ordering; other organic parts retain physical world-object occlusion.
|
|
8087
|
+
`body.outline: { color, width }` is independent of anatomy. Optional
|
|
8088
|
+
`body.shading: { mode: 'cel' | 'none', light: [x,y], shadow, opacity, highlight }`
|
|
8089
|
+
is deterministic and clipped to skin. Defaults include small natural hands.
|
|
8090
|
+
`softCartoonCharacter('youngMan' | 'youngWoman' | 'childBoy' | 'childGirl', options)`
|
|
8091
|
+
provides editable original actors; `SOFT_CARTOON_CAST` contains their source
|
|
8092
|
+
options. Children default to shorter heights, larger head proportions, shorter
|
|
8093
|
+
limbs and rounded torsos. Override `height` to change size while preserving
|
|
8094
|
+
their anatomy. Use `outfitPreset('everyday' | 'formal' | 'casual', overrides)`
|
|
8095
|
+
for owned JSON wardrobe defaults. `outfit.top` is `tshirt | shirt | blouse |
|
|
8096
|
+
dress`; `trouserStyle` is `plain | jeans | cargo`; `shirt` and `trousers`
|
|
8097
|
+
remain colour fields. Bottoms are `trousers | shorts | skirt`; sleeves,
|
|
8098
|
+
collar and tie colour are editable. Dresses force a skirt in the top colour.
|
|
8099
|
+
All garments are available for every actor. `outfit` adapts to organic contours; organic-only `leafOutfit` accepts
|
|
8100
|
+
`{ top?, color?, accent?, length? }`. Use the existing `characterScript`,
|
|
8101
|
+
`characterPoseTracks`, `reachCharacter`, hand pose and `hairFollowTracks`
|
|
8102
|
+
APIs for motion. Avoid a foreground whole-body overlay. An unrigged PNG
|
|
8103
|
+
is not a posable character. The interactive example is
|
|
8104
|
+
`/examples/live-organic-characters`; a headless study is
|
|
8105
|
+
`examples/headless-video/organic-characters.mjs`. Child proportions and poses
|
|
8106
|
+
are shown in `examples/headless-video/child-characters.mjs`.
|
|
8107
|
+
|
|
7924
8108
|
A v2 character's appearance is plain options to `character()`, never drawing
|
|
7925
8109
|
code: `build` (`child`, `tall`, `short`…), `hair` (a style name, or
|
|
7926
8110
|
`{ style, color, length, … }`), `facialHair`, `glasses`, `hat`, `ears: true`,
|
|
@@ -7929,6 +8113,9 @@ code: `build` (`child`, `tall`, `short`…), `hair` (a style name, or
|
|
|
7929
8113
|
'cardigan' | 'overalls' | 'sari' | 'apron' | 'labCoat', shoes: 'boots' }`.
|
|
7930
8114
|
Built-in tops hide thighs and trouser roots under their hem during turns;
|
|
7931
8115
|
garments spanning both legs use the resolved body order in camera views too.
|
|
8116
|
+
Custom camera-view garment details should use `joints.bodyForward` (view-space
|
|
8117
|
+
body axis: `z` front visibility, `x` side offset), independent of head yaw.
|
|
8118
|
+
`joints.turn` remains authored; flat joints omit `bodyForward`.
|
|
7932
8119
|
For custom clothes, `layers.parts[id].clip` clips only the bare body before
|
|
7933
8120
|
`over` draws, and `joints.parts[id].order` gives the drawing index.
|
|
7934
8121
|
`castMember('grandpa', 300)` gives a whole ready-made character to start
|
|
@@ -8127,6 +8314,9 @@ new-tab player using the same standalone HTML as Copy code. Live demos,
|
|
|
8127
8314
|
timeline examples and editable sample scenes play with their own controls
|
|
8128
8315
|
and scrolling, without the gallery panels. Use these URLs when sharing an
|
|
8129
8316
|
example for visual review.
|
|
8317
|
+
Development live previews load the local browser API and required add-ons, so
|
|
8318
|
+
unpublished APIs work before release. Production previews and copied pages
|
|
8319
|
+
keep the versioned CDN URLs.
|
|
8130
8320
|
|
|
8131
8321
|
---
|
|
8132
8322
|
|
|
@@ -8159,7 +8349,7 @@ path for all of that:
|
|
|
8159
8349
|
</figure>
|
|
8160
8350
|
|
|
8161
8351
|
<!-- once, anywhere on the page (a site-wide footer is fine) -->
|
|
8162
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
8352
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.109.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
|
|
8163
8353
|
```
|
|
8164
8354
|
|
|
8165
8355
|
Every `[data-tinyfly-embed]` mounts when the page is ready, with no per-post
|
|
@@ -9431,8 +9621,8 @@ On a page with no build step, load the maps add-on after the browser bundle; it
|
|
|
9431
9621
|
adds to the same `tinyfly` global:
|
|
9432
9622
|
|
|
9433
9623
|
```html
|
|
9434
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
9435
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
9624
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.109.0/cdn/tinyfly.iife.js"></script>
|
|
9625
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.109.0/cdn/tinyfly-maps.iife.js"></script>
|
|
9436
9626
|
```
|
|
9437
9627
|
|
|
9438
9628
|
It is a separate script because the offline world map it carries adds about
|
|
@@ -9674,6 +9864,147 @@ drawCharacter(ctx, maya, humanPose({ ...HUMAN_EXPRESSIONS.embarrassed, turn: 0.5
|
|
|
9674
9864
|
A plain figure (no `hair`, `facialHair`, `glasses`, `hat` or `ears`) draws
|
|
9675
9865
|
exactly as it did before these options existed.
|
|
9676
9866
|
|
|
9867
|
+
## Organic cartoon bodies
|
|
9868
|
+
|
|
9869
|
+
Use `figure: 'organic'` for original, softly drawn story characters. The
|
|
9870
|
+
existing human skeleton controls poses, reaching, ground contact and part
|
|
9871
|
+
order. Filled contours supply shoulders, chest, waist, hips and shaped
|
|
9872
|
+
limbs; dimensions are independent of the outline width.
|
|
9873
|
+
|
|
9874
|
+
```js
|
|
9875
|
+
import { character, softCartoonCharacter, characterScript, hairFollowTracks } from '@algorisys/tinyfly/characters'
|
|
9876
|
+
|
|
9877
|
+
const actor = character({
|
|
9878
|
+
figure: 'organic', height: 320, skin: '#efbd96',
|
|
9879
|
+
body: {
|
|
9880
|
+
arm: [{ at: 0, width: 0.028 }, { at: 0.5, width: 0.018 },
|
|
9881
|
+
{ at: 0.7, width: 0.023 }, { at: 1, width: 0.012 }],
|
|
9882
|
+
outline: { color: '#53372d', width: 1.5 },
|
|
9883
|
+
shading: { mode: 'cel', light: [-0.8, -0.6], opacity: 0.17 },
|
|
9884
|
+
},
|
|
9885
|
+
face: { style: 'anime', shape: 'angular', jawRoundness: 1 },
|
|
9886
|
+
hair: { style: 'flowingBob', color: '#38291f' },
|
|
9887
|
+
outfit: { shirt: '#72958b', trousers: '#495a67' },
|
|
9888
|
+
})
|
|
9889
|
+
const friend = softCartoonCharacter('youngWoman', { height: 300 })
|
|
9890
|
+
const story = characterScript('actor', actor, [
|
|
9891
|
+
{ do: 'walk', to: 240, for: 2200 },
|
|
9892
|
+
{ do: 'say', say: 'Let us explore!', for: 1800, mood: 'happy' },
|
|
9893
|
+
], { from: 60 })
|
|
9894
|
+
story.tracks.push(...hairFollowTracks('actor', story.tracks, actor))
|
|
9895
|
+
```
|
|
9896
|
+
|
|
9897
|
+
`softCartoonCharacter` accepts only `youngMan`, `youngWoman`, `childBoy`
|
|
9898
|
+
and `childGirl`; unknown actor names throw an error, including inherited
|
|
9899
|
+
object keys such as `constructor`.
|
|
9900
|
+
|
|
9901
|
+
`body.torso`, `arm`, `leg` and `neck` are arrays of `{ at, width }`.
|
|
9902
|
+
`at` increases from 0 to 1; `width` is a half-width fraction of character
|
|
9903
|
+
height. Torso positions run hip to neck, arms shoulder to wrist, and legs
|
|
9904
|
+
hip to ankle. Cubic centerlines pass through native elbow/knee joints with
|
|
9905
|
+
interpolated width profiles. Options are copied at construction and can
|
|
9906
|
+
travel as JSON. `body.depth` (0.2–1, default 0.55) sets torso side thickness.
|
|
9907
|
+
`body.fill` overrides `skin` for all exposed body, face and palms; omit it
|
|
9908
|
+
to keep one `skin` colour control. The editor's Skin and Line controls show
|
|
9909
|
+
the resolved fill and outline colour; editing them also updates any existing
|
|
9910
|
+
`body.fill` or `body.outline.color` override without changing other body options.
|
|
9911
|
+
|
|
9912
|
+
Default organic hands are small natural five-finger hands (`handSize: 0.073`).
|
|
9913
|
+
Existing `hand.left.*` / `hand.right.*` tracks control palms, fists, pointing,
|
|
9914
|
+
bends and wrist rolls. Foreground organic arms and hands draw together after
|
|
9915
|
+
the torso and lower garments; rear arms remain behind them. Attached borders at shoulders, hips, wrists and ankles are hidden
|
|
9916
|
+
where connected contours meet. This ordering also survives the 3D scene's
|
|
9917
|
+
global depth sort, while separate world objects can still occlude the figure.
|
|
9918
|
+
`characterPartsInView()` retains each part's physical `depth` and supplies
|
|
9919
|
+
an organic `sortDepth` for painter ordering. Only foreground arms are promoted
|
|
9920
|
+
to the nearest torso/leg garment depth; head, neck, torso, legs and rear arms
|
|
9921
|
+
keep their physical depths. Scene integrations sort by `sortDepth ?? depth`, retaining array
|
|
9922
|
+
order for ties. Fluid and stick parts retain their existing depth ordering.
|
|
9923
|
+
|
|
9924
|
+
Organic faces default to `face.projection: 'volume'`: feature centres follow
|
|
9925
|
+
the head's 3D axes, both eyes stay readable in three-quarter views, the far
|
|
9926
|
+
eye narrows toward profile, and opaque hair covers
|
|
9927
|
+
eyes and brows. Features stay clipped inside the head through turns and nods.
|
|
9928
|
+
The facial plane is flatter than the rounded rear cranium in profile.
|
|
9929
|
+
With `face.nose: true`, a small nose projects from above the mouth and shapes
|
|
9930
|
+
the turned silhouette without extending the chin.
|
|
9931
|
+
`projection: 'cartoon'` retains the classic face slide used by fluid/stick.
|
|
9932
|
+
|
|
9933
|
+
Cel shading is clipped to moving skin in the clean look. `body.shading`
|
|
9934
|
+
accepts `mode: 'cel' | 'none'`, screen-space `light: [x, y]`, `shadow`,
|
|
9935
|
+
`opacity` and `highlight`. Seeking and headless rendering are deterministic.
|
|
9936
|
+
Pencil and silhouette use their existing pens. Artist-authored painted
|
|
9937
|
+
meshes remain a separate future capability.
|
|
9938
|
+
|
|
9939
|
+
Set `body.fill: 'none'` (or `skin: 'none'` without a body fill override) for
|
|
9940
|
+
outline-only exposed body, head and hands in every look. Dot and articulated
|
|
9941
|
+
hands omit skin fills and shading; clothing retains its own material.
|
|
9942
|
+
|
|
9943
|
+
Everyday shirts, sleeves, trousers, shorts and skirts follow organic anatomy.
|
|
9944
|
+
`leafOutfit: { top: true, color: '#638c39', accent: '#87ae4e', length: 0.32 }`
|
|
9945
|
+
selects attached leaf garments with curved shapes and veins; `top: false`
|
|
9946
|
+
leaves the upper body uncovered. It requires organic mode.
|
|
9947
|
+
`leafOutfitContours(joints, options)` exposes plain coverage geometry for
|
|
9948
|
+
custom layers and exporters. Both wardrobes use native part depths.
|
|
9949
|
+
|
|
9950
|
+
`softCartoonCharacter('childBoy')` and `softCartoonCharacter('childGirl')`
|
|
9951
|
+
provide original child presets with a larger head/body ratio, shorter arms
|
|
9952
|
+
and legs, rounded torsos and smaller default heights (230 and 225 px).
|
|
9953
|
+
All face, hair, clothes, skin and proportions remain editable; changing
|
|
9954
|
+
`height` preserves the child anatomy. The same pose, script, hand, reaching
|
|
9955
|
+
and lip-sync APIs work for adults and children.
|
|
9956
|
+
|
|
9957
|
+
The example at `/examples/live-organic-characters` includes adult, child and
|
|
9958
|
+
adult/child pairs, face/hair
|
|
9959
|
+
choices, independently editable everyday/formal/casual/leaf garments, seven actions, outline and skin controls,
|
|
9960
|
+
shading, playback and scrubbing. Available in v0.108.0. See the
|
|
9961
|
+
[contact sheet](model-sheet/organic-characters.png) and
|
|
9962
|
+
[child character sheet](model-sheet/child-characters.png).
|
|
9963
|
+
Close-up [head turns](model-sheet/organic-head-turns.png) exercise independent
|
|
9964
|
+
`head.turn` at the story's body orientation.
|
|
9965
|
+
`fluid` and `stick` keep their existing defaults and ink-based dimensions.
|
|
9966
|
+
|
|
9967
|
+
## Everyday, Formal and Casual clothing
|
|
9968
|
+
|
|
9969
|
+
`outfitPreset(category, overrides)` returns fresh plain JSON options for
|
|
9970
|
+
`character({ outfit })` or `softCartoonCharacter(name, { outfit })`.
|
|
9971
|
+
The categories are `everyday`, `formal` and `casual`. Every garment works
|
|
9972
|
+
with adult and child actors, regardless of gender.
|
|
9973
|
+
|
|
9974
|
+
```js
|
|
9975
|
+
import { softCartoonCharacter, outfitPreset } from '@algorisys/tinyfly/characters'
|
|
9976
|
+
|
|
9977
|
+
const formal = softCartoonCharacter('youngMan', {
|
|
9978
|
+
outfit: outfitPreset('formal', { shirt: '#ece6db', trousers: '#354456', tie: '#7b3955' }),
|
|
9979
|
+
})
|
|
9980
|
+
const casual = softCartoonCharacter('youngWoman', {
|
|
9981
|
+
outfit: outfitPreset('casual', { top: 'tshirt', bottom: 'shorts', trouserStyle: 'cargo' }),
|
|
9982
|
+
})
|
|
9983
|
+
const dress = softCartoonCharacter('childGirl', {
|
|
9984
|
+
outfit: outfitPreset('formal', { top: 'dress', shirt: '#aa6b91', sleeves: 'none' }),
|
|
9985
|
+
})
|
|
9986
|
+
```
|
|
9987
|
+
|
|
9988
|
+
- `top`: `tshirt`, `shirt` (button placket), `blouse` (V neckline) or `dress`.
|
|
9989
|
+
Omit it to retain the original plain T-shirt. Shirts default to a collar;
|
|
9990
|
+
an explicit `collar: false` removes it.
|
|
9991
|
+
- `bottom`: `trousers`, `shorts` or `skirt`; `trouserStyle`: `plain`, `jeans`
|
|
9992
|
+
(pockets and stitching) or `cargo` (thigh pockets). Details follow the
|
|
9993
|
+
limbs and stay clipped inside the fabric.
|
|
9994
|
+
- `shirt` and `trousers` remain top and bottom colours. A dress uses
|
|
9995
|
+
`shirt` for both its bodice and skirt, overriding `bottom` and ignoring
|
|
9996
|
+
the separate bottom colour. `sleeves` accepts `short`, `long` or `none`.
|
|
9997
|
+
- `collar` is a boolean; `tie` is a colour or `null` to remove it. Changing a
|
|
9998
|
+
formal preset to a different top removes its default collar and tie;
|
|
9999
|
+
explicit accessory overrides take precedence.
|
|
10000
|
+
|
|
10001
|
+
The example's **Edit outfit** choice edits both characters or either actor
|
|
10002
|
+
separately. Formal starts with a shirt/tie or blouse/skirt; Casual starts
|
|
10003
|
+
with a T-shirt/jeans. All cuts remain selectable for either character.
|
|
10004
|
+
The editor exposes the same presets and garment choices, saved with scene
|
|
10005
|
+
JSON. [Clothing sheet](model-sheet/clothing-options.png), reproduced by
|
|
10006
|
+
`examples/headless-video/clothing-options.mjs`.
|
|
10007
|
+
|
|
9677
10008
|
## How it turns
|
|
9678
10009
|
|
|
9679
10010
|
Hair, beards and hats are not flat drawings pasted on the face. Each is a
|
|
@@ -9926,6 +10257,13 @@ body part before it draws. Set the canvas clipping path in this hook; it is
|
|
|
9926
10257
|
restored before the part's `over` layers and the next part. The built-in outfit
|
|
9927
10258
|
uses this to hide thighs under tops. `joints.parts[id].order` is the resolved
|
|
9928
10259
|
far-to-near drawing index; use it when a garment spans several parts.
|
|
10260
|
+
Camera-projected joints also provide `bodyForward: [x,y,z]` in view space:
|
|
10261
|
+
`z` is front visibility and `x` is the side offset for front details. This
|
|
10262
|
+
axis follows the body and camera independently of head yaw. `joints.turn`
|
|
10263
|
+
retains the authored body turn; flat drawing omits `bodyForward`, so use
|
|
10264
|
+
`cos(turn * Math.PI / 2)` and `sin(turn * Math.PI / 2)` there.
|
|
10265
|
+
The built-in wardrobe uses this direction for front buttons, necklines,
|
|
10266
|
+
pockets, collars, ties and outer-garment details.
|
|
9929
10267
|
|
|
9930
10268
|
## The cast
|
|
9931
10269
|
|
|
@@ -14459,7 +14797,7 @@ magnet.addEventListener('pointerleave', () => {
|
|
|
14459
14797
|
|
|
14460
14798
|
<!-- capabilities: generated from the library -->
|
|
14461
14799
|
|
|
14462
|
-
# tinyfly capabilities (v0.
|
|
14800
|
+
# tinyfly capabilities (v0.109.0)
|
|
14463
14801
|
|
|
14464
14802
|
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).
|
|
14465
14803
|
|
|
@@ -14743,11 +15081,18 @@ Native dances: `garba`, `garbaThreeClap`, `dandiya`; `humanDanceFrame(style, bea
|
|
|
14743
15081
|
Appearance options of `character({ … })`, all plain data that turns with the head (see docs/character-appearance.md):
|
|
14744
15082
|
|
|
14745
15083
|
- `build`: `standard`, `slim`, `tall`, `short`, `broad`, `curvy`, `stocky`, `kid`, `child`, `toddler`
|
|
15084
|
+
- `figure`: `fluid`, `stick`, `organic`
|
|
15085
|
+
- `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.
|
|
15086
|
+
- `body.fill · body.outline · body.shading`: Shared skin fill, outline { color, width }, cel material { mode: cel | none, light: [x,y], shadow, opacity, highlight }.
|
|
15087
|
+
- `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.
|
|
15088
|
+
- `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.
|
|
15089
|
+
- `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.
|
|
15090
|
+
- `leafOutfit`: Organic-only JSON garment { top?, color?, accent?, length? }; curved leaves follow torso/thighs at native part depths. Everyday basicOutfit also follows organic contours.
|
|
14746
15091
|
- `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`)
|
|
14747
15092
|
- 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.
|
|
14748
15093
|
- `facialHair`: `cleanShaven`, `stubble`, `pencilMoustache`, `shortMoustache`, `chevron`, `handlebar`, `walrus`, `goatee`, `vanDyke`, `circleBeard`, `shortBoxed`, `fullBeard`, `longBeard`, `roundedBeard`, `pointedBeard`, `chinStrap`, `soulPatch`, `sideburns`, `muttonChops`, `moustacheStubble`
|
|
14749
15094
|
- `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`
|
|
14750
|
-
- `outfit`: `{ shirt, trousers, sleeves: short | long | none, bottom: trousers | shorts | skirt, collar, tie: colour, over: apron | labCoat | hoodie | cardigan | overalls | sari, overColor, shoes: boots, shoeColor }`
|
|
15095
|
+
- `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 }`
|
|
14751
15096
|
- `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`
|
|
14752
15097
|
- 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
|
|
14753
15098
|
- 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`.
|
|
@@ -14867,6 +15212,29 @@ Edits:
|
|
|
14867
15212
|
- `move`: a part; { at, to: an anchor name or { x, y }, duration? }: carry the part there, loose
|
|
14868
15213
|
- `fling`: a part; { at, velocity?, spin?, gravity?, duration? }: knock the part off on a spinning arc
|
|
14869
15214
|
|
|
15215
|
+
## Cricket stories (`@algorisys/tinyfly/sports`)
|
|
15216
|
+
|
|
15217
|
+
`cricketClip({ format, action, cast })` returns an organic-player scene, JSON tracks, timed events/captions and a declared result. `cricketField`, `cricketPlayer` and `cricketAction` compose separately; `cricketCameraTracks` adds camera tracks. These are authored tutorial plays, not physics or automatic umpiring. See docs/cricket.md.
|
|
15218
|
+
|
|
15219
|
+
- `bowling`: Run up, deliver with a straight arm, bounce and follow through.
|
|
15220
|
+
- `spin`: A shorter approach and a curved illustrative flight before the bounce.
|
|
15221
|
+
- `batting`: Two hands on the bat, a backlift, contact and a follow-through.
|
|
15222
|
+
- `defend`: Meet the ball with a controlled bat and keep it close.
|
|
15223
|
+
- `running`: Both batters make the opposite ground to complete one run.
|
|
15224
|
+
- `four`: A struck ball reaches the boundary after touching the ground.
|
|
15225
|
+
- `six`: A struck ball clears the boundary before touching the ground.
|
|
15226
|
+
- `catch`: A fielder controls the struck ball before it touches the ground.
|
|
15227
|
+
- `fielding`: A fielder moves to the ball, bends and gathers it.
|
|
15228
|
+
- `throw`: Gather, wind up, release and return the ball to the keeper.
|
|
15229
|
+
- `bowled`: A legal delivery hits the wicket and removes a bail.
|
|
15230
|
+
- `lbw`: Pad contact and a projected path to the stumps illustrate an authored LBW decision.
|
|
15231
|
+
- `stumping`: The keeper holds the ball and breaks the wicket while the striker is out of ground, not attempting a run.
|
|
15232
|
+
- `run-out`: A direct throw breaks the wicket before the running batter makes that ground.
|
|
15233
|
+
- `no-ball`: The landing front foot oversteps the popping crease at release; one extra, no legal ball.
|
|
15234
|
+
- `wide`: An untouched delivery passes beyond reach for a normal stroke; one extra, no legal ball.
|
|
15235
|
+
|
|
15236
|
+
Formats: `test`, `odi`, `t20`. Casts: adults, children, mixed. Cameras: `pitch`, `batter`, `bowler`, `keeper`, `field`, `overhead`, `orbit`, `follow-ball`. Orbit turns 360° around the whole ground.
|
|
15237
|
+
|
|
14870
15238
|
## Camera shots (`cameraTracks(shots, { stage })`)
|
|
14871
15239
|
|
|
14872
15240
|
- **frame**: `{ at, duration?, easing?, frame: { focus?: { x, y }, scale?, rotate? } }: push in, pull out, or cut (duration 0)`
|