@algorisys/tinyfly 0.98.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 +10 -10
- package/docs/acting.md +81 -14
- package/docs/character-appearance.md +96 -10
- package/docs/editor-guide.md +76 -4
- 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 +29 -9
- package/docs/maps.md +2 -2
- package/docs/props.md +61 -1
- package/docs/scene-3d.md +3 -1
- package/docs/teaching.md +1 -1
- package/lib/addons/characters.js +6709 -5248
- package/lib/browser/tinyfly.iife.js +15 -15
- package/lib/browser/tinyfly.js +7532 -6071
- package/lib/browser/tinyfly.umd.js +15 -15
- package/lib/types/characters/acting/character-script.d.ts +56 -0
- package/lib/types/characters/acting/index.d.ts +1 -0
- 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 +21 -2
- package/lib/types/characters/chart.d.ts +52 -14
- package/lib/types/characters/hair-follow.d.ts +82 -0
- 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/head/hair.d.ts +27 -1
- package/lib/types/characters/head/head-look.d.ts +5 -2
- package/lib/types/characters/head/index.d.ts +1 -1
- package/lib/types/characters/index.d.ts +4 -2
- package/lib/types/characters/interactions.d.ts +60 -0
- package/lib/types/characters/props/draw.d.ts +9 -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/prop-surface.d.ts +14 -3
- package/lib/types/characters/props/ride-3d.d.ts +34 -2
- package/lib/types/characters/props/target.d.ts +5 -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 +8 -0
- package/lib/types/characters/wardrobe/basic-outfit.d.ts +16 -5
- package/lib/types/characters/whiteboard.d.ts +13 -1
- package/llms-full.txt +400 -70
- package/llms.txt +29 -29
- package/package.json +2 -2
- package/skills/tinyfly/SKILL.md +22 -10
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { ActingRig } from '../../acting/acting';
|
|
2
|
+
import type { Prop } from '../target';
|
|
3
|
+
/**
|
|
4
|
+
* Furniture: a chair, a desk, a bed, a door and a wheelchair, with the places
|
|
5
|
+
* a figure uses them at as anchors (`seat`, `top`, `mattress`, `handle`…) so
|
|
6
|
+
* a script can sit, work, lie and go through. They stand on the ground facing the viewer
|
|
7
|
+
* (`turn` 0) and turn like any prop; a chair tips back on its rear legs, a
|
|
8
|
+
* desk's drawer slides out, a bed's mattress gives when someone lands on it,
|
|
9
|
+
* and a door opens on its hinge, slams, and rattles when knocked.
|
|
10
|
+
*/
|
|
11
|
+
export interface ChairSpec {
|
|
12
|
+
kind?: string;
|
|
13
|
+
summary?: string;
|
|
14
|
+
/** Seat width and depth, seat height, and the back's height above the floor, metres */
|
|
15
|
+
width?: number;
|
|
16
|
+
depth?: number;
|
|
17
|
+
seatHeight?: number;
|
|
18
|
+
backHeight?: number;
|
|
19
|
+
colors?: {
|
|
20
|
+
wood?: string;
|
|
21
|
+
seat?: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** A chair: a seat on four legs with a back; tips back on its rear legs. */
|
|
25
|
+
export declare function chair(spec?: ChairSpec): Prop;
|
|
26
|
+
export declare const CHAIR_ACTING: ActingRig;
|
|
27
|
+
export interface DeskSpec {
|
|
28
|
+
kind?: string;
|
|
29
|
+
summary?: string;
|
|
30
|
+
/** Across, front to back, and the top's height, metres */
|
|
31
|
+
width?: number;
|
|
32
|
+
depth?: number;
|
|
33
|
+
height?: number;
|
|
34
|
+
colors?: {
|
|
35
|
+
wood?: string;
|
|
36
|
+
top?: string;
|
|
37
|
+
knob?: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** A desk: a top on four legs, with a drawer that slides out of the front. */
|
|
41
|
+
export declare function desk(spec?: DeskSpec): Prop;
|
|
42
|
+
export declare const DESK_ACTING: ActingRig;
|
|
43
|
+
export interface BedSpec {
|
|
44
|
+
kind?: string;
|
|
45
|
+
summary?: string;
|
|
46
|
+
/** Length (head to foot), width, the mattress top's height, and the headboard's height, metres */
|
|
47
|
+
length?: number;
|
|
48
|
+
width?: number;
|
|
49
|
+
height?: number;
|
|
50
|
+
headboard?: number;
|
|
51
|
+
colors?: {
|
|
52
|
+
wood?: string;
|
|
53
|
+
mattress?: string;
|
|
54
|
+
blanket?: string;
|
|
55
|
+
pillow?: string;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/** A bed: a frame with a headboard, a mattress with a blanket, a pillow; the mattress gives when someone lands on it. */
|
|
59
|
+
export declare function bed(spec?: BedSpec): Prop;
|
|
60
|
+
export declare const BED_ACTING: ActingRig;
|
|
61
|
+
export interface DoorSpec {
|
|
62
|
+
kind?: string;
|
|
63
|
+
summary?: string;
|
|
64
|
+
/** The opening's width and height, metres */
|
|
65
|
+
width?: number;
|
|
66
|
+
height?: number;
|
|
67
|
+
/** Which side the hinge is on, seen from the front (default left) */
|
|
68
|
+
hinge?: 'left' | 'right';
|
|
69
|
+
colors?: {
|
|
70
|
+
frame?: string;
|
|
71
|
+
door?: string;
|
|
72
|
+
handle?: string;
|
|
73
|
+
beyond?: string;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/** A door in its frame: opens on its hinge, slams, and rattles when knocked; the doorway behind shows when it opens. */
|
|
77
|
+
export declare function door(spec?: DoorSpec): Prop;
|
|
78
|
+
export declare const DOOR_ACTING: ActingRig;
|
|
79
|
+
export interface WheelchairSpec {
|
|
80
|
+
/** Seat width, metres (default 0.5) */
|
|
81
|
+
width?: number;
|
|
82
|
+
/** Seat height off the ground, metres (default 0.5) */
|
|
83
|
+
seatHeight?: number;
|
|
84
|
+
/** The big wheels' radius, metres (default 0.3) */
|
|
85
|
+
wheelRadius?: number;
|
|
86
|
+
colors?: {
|
|
87
|
+
frame?: string;
|
|
88
|
+
seat?: string;
|
|
89
|
+
tyre?: string;
|
|
90
|
+
};
|
|
91
|
+
kind?: string;
|
|
92
|
+
summary?: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* A wheelchair: a seat and back on a frame, two big rimmed wheels at the back
|
|
96
|
+
* (hand rims a rider turns), two castors at the front, footrests and push
|
|
97
|
+
* handles. Any character rides it (`propRide3D` on its `seat` in the
|
|
98
|
+
* `wheeling` pose); a pusher stands at `handles`. It is an accessory, not an
|
|
99
|
+
* age or a build: who sits in it is the story's choice.
|
|
100
|
+
*/
|
|
101
|
+
export declare function wheelchair(spec?: WheelchairSpec): Prop;
|
|
102
|
+
export declare const WHEELCHAIR_ACTING: ActingRig;
|
|
@@ -14,6 +14,7 @@ export * from './effects';
|
|
|
14
14
|
export * from './families/vehicle';
|
|
15
15
|
export * from './ride';
|
|
16
16
|
export * from './families/environment';
|
|
17
|
+
export * from './families/furniture';
|
|
17
18
|
export * from './families/aircraft';
|
|
18
19
|
export * from './families/animals';
|
|
19
20
|
export * from './families/birds';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { Prop } from './target';
|
|
2
2
|
import { car, truck, bus, tractor, cart, trainCar, bike, motorbike } from './families/vehicle';
|
|
3
3
|
import { tree, house } from './families/environment';
|
|
4
|
+
import { chair, desk, bed, door, wheelchair } from './families/furniture';
|
|
4
5
|
import { helicopter, airplane } from './families/aircraft';
|
|
5
|
-
import { horse, dog, cat, cow } from './families/animals';
|
|
6
|
-
import { songbird, crow, chicken } from './families/birds';
|
|
6
|
+
import { horse, dog, cat, cow, goat, rabbit, squirrel } from './families/animals';
|
|
7
|
+
import { songbird, crow, chicken, pigeon, duck, owl, parrot } from './families/birds';
|
|
7
8
|
/**
|
|
8
9
|
* Every prop preset by name, so a prop can be named in plain data (a 3D
|
|
9
10
|
* scene's `{ kind: 'prop', prop: 'car' }`, the catalog).
|
|
@@ -19,15 +20,27 @@ export declare const PROP_PRESETS: {
|
|
|
19
20
|
motorbike: typeof motorbike;
|
|
20
21
|
tree: typeof tree;
|
|
21
22
|
house: typeof house;
|
|
23
|
+
chair: typeof chair;
|
|
24
|
+
desk: typeof desk;
|
|
25
|
+
bed: typeof bed;
|
|
26
|
+
door: typeof door;
|
|
27
|
+
wheelchair: typeof wheelchair;
|
|
22
28
|
helicopter: typeof helicopter;
|
|
23
29
|
airplane: typeof airplane;
|
|
24
30
|
horse: typeof horse;
|
|
25
31
|
dog: typeof dog;
|
|
26
32
|
cat: typeof cat;
|
|
27
33
|
cow: typeof cow;
|
|
34
|
+
goat: typeof goat;
|
|
35
|
+
rabbit: typeof rabbit;
|
|
36
|
+
squirrel: typeof squirrel;
|
|
28
37
|
songbird: typeof songbird;
|
|
29
38
|
crow: typeof crow;
|
|
30
39
|
chicken: typeof chicken;
|
|
40
|
+
pigeon: typeof pigeon;
|
|
41
|
+
duck: typeof duck;
|
|
42
|
+
owl: typeof owl;
|
|
43
|
+
parrot: typeof parrot;
|
|
31
44
|
};
|
|
32
45
|
export type PropPresetName = keyof typeof PROP_PRESETS;
|
|
33
46
|
/** A preset by name, with its options (colours, sizes); throws on a name it does not know, with the one probably meant. */
|
|
@@ -30,6 +30,12 @@ import { type PropTarget } from './target';
|
|
|
30
30
|
* that drives off. Edits are keys on its controls, written out by `tracks()`
|
|
31
31
|
* on the prop target's id. Do not key a control both here and in its own
|
|
32
32
|
* script: the later track wins.
|
|
33
|
+
*
|
|
34
|
+
* A part can come loose: `piece('part:wheel-0-left')` makes it a piece that
|
|
35
|
+
* `fling`, `follow` and `move` carry off (or the `fling` and `move` edits),
|
|
36
|
+
* drawn where it went. Every anchor and part is a floor: a figure standing
|
|
37
|
+
* on the roof (`onto: { surface, anchor: 'anchor:roof' }`) is carried with
|
|
38
|
+
* it as the prop lifts, drives or is squashed (`ride()`).
|
|
33
39
|
*/
|
|
34
40
|
export interface PropSurfaceOptions {
|
|
35
41
|
/** The prop's own tracks (its `propScript` result), so its places follow it as it moves */
|
|
@@ -40,8 +46,8 @@ export interface PropSurface extends Surface {
|
|
|
40
46
|
readonly prop: PropTarget;
|
|
41
47
|
/** The box at a named place, at `time` (default: after every edit): `box`, `anchor:NAME`, `part:ID`, `control:NAME` */
|
|
42
48
|
anchor(name: string, time?: number): SurfaceBox;
|
|
43
|
-
/**
|
|
44
|
-
piece(anchor: string):
|
|
49
|
+
/** Make the part at a `part:` place a piece that can come loose (with the parts built on it: a wheel and its hub) */
|
|
50
|
+
piece(anchor: string): PropPiece;
|
|
45
51
|
/** Change the prop at a time: `set` a control to a value, or `switch` it on (open) or off (shut) */
|
|
46
52
|
edit(name: string, anchor: string | string[], options: SurfaceEditOptions): PropSurface;
|
|
47
53
|
follow(piece: SurfacePiece, path: TimedPoint[]): PropSurface;
|
|
@@ -52,12 +58,17 @@ export interface PropSurface extends Surface {
|
|
|
52
58
|
y: number;
|
|
53
59
|
};
|
|
54
60
|
}): PropSurface;
|
|
55
|
-
/**
|
|
61
|
+
/** A figure's tracks with it carried by the anchor or part it stands on, as the prop moves */
|
|
56
62
|
ride(tracks: Track[], target: string, options: {
|
|
57
63
|
ground: number;
|
|
58
64
|
every?: number;
|
|
59
65
|
}): Track[];
|
|
60
66
|
tracks(target: string): Track[];
|
|
61
67
|
}
|
|
68
|
+
/** A part of a prop that has come loose. */
|
|
69
|
+
export interface PropPiece extends SurfacePiece {
|
|
70
|
+
/** The part's id */
|
|
71
|
+
readonly part: string;
|
|
72
|
+
}
|
|
62
73
|
export declare const PROP_SURFACE: SurfaceAbout;
|
|
63
74
|
export declare function propSurface(target: PropTarget, options?: PropSurfaceOptions): PropSurface;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Track } from '../../engine/types';
|
|
2
2
|
import type { Vec3 } from '../../engine/math';
|
|
3
3
|
import type { Pose } from '../rig/body-plan';
|
|
4
|
-
import { type CharacterOptions } from '../character';
|
|
4
|
+
import { type CharacterOptions, type CharacterPoseKey } from '../character';
|
|
5
5
|
import type { Prop } from './target';
|
|
6
6
|
/**
|
|
7
7
|
* Riding in a 3D scene: a character carried by a prop, its hips kept on a
|
|
@@ -62,10 +62,42 @@ export interface PropRide3DOptions {
|
|
|
62
62
|
/** Sample spacing, ms (default 33) */
|
|
63
63
|
every?: number;
|
|
64
64
|
}
|
|
65
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* Riding poses for a human: on a seat, astride a saddle (legs apart round a
|
|
67
|
+
* horse's barrel), driving (hands forward on a wheel) and on a bike's saddle
|
|
68
|
+
* (leaning to the handlebars; the legs cycle with `pedallingPose`), and
|
|
69
|
+
* wheeling a wheelchair (sitting up, the arms down at the sides to the hand
|
|
70
|
+
* rims).
|
|
71
|
+
*/
|
|
66
72
|
export declare const RIDING_POSES: {
|
|
67
73
|
seated: Pose;
|
|
68
74
|
astride: Pose;
|
|
75
|
+
driving: Pose;
|
|
76
|
+
wheeling: Pose;
|
|
77
|
+
cycling: Pose;
|
|
69
78
|
};
|
|
79
|
+
/**
|
|
80
|
+
* The cycling pose with the legs part way round the pedals: `phase` 0 → 1
|
|
81
|
+
* is one turn of the cranks (the left foot at the top at 0, the right half a
|
|
82
|
+
* turn behind), built on `base` (default `RIDING_POSES.cycling`).
|
|
83
|
+
*/
|
|
84
|
+
export declare function pedallingPose(phase: number, base?: Pose): Pose;
|
|
85
|
+
export interface PedallingOptions {
|
|
86
|
+
/** From and to, ms */
|
|
87
|
+
start: number;
|
|
88
|
+
end: number;
|
|
89
|
+
/** Turns of the cranks per second (default 1.2) */
|
|
90
|
+
cadence?: number;
|
|
91
|
+
/** The pose the legs cycle on (default `RIDING_POSES.cycling`) */
|
|
92
|
+
base?: Pose;
|
|
93
|
+
/** Keys per turn (default 8) */
|
|
94
|
+
samplesPerTurn?: number;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Pose keys that pedal from `start` to `end` (`act: false`: a cycle is
|
|
98
|
+
* already timed), for a rider's own pose tracks (`characterPoseTracks` or
|
|
99
|
+
* `actCharacterTracks`) while `propRide3D` or `propRide` carries it.
|
|
100
|
+
*/
|
|
101
|
+
export declare function pedallingKeys(options: PedallingOptions): CharacterPoseKey[];
|
|
70
102
|
/** The rider's `x`, `y`, `z` and `rotateY` tracks while it rides (see the module's notes). */
|
|
71
103
|
export declare function propRide3D(options: PropRide3DOptions): Track[];
|
|
@@ -3,7 +3,7 @@ import type { PropertyInfo } from '../../adapters/canvas/target-properties';
|
|
|
3
3
|
import type { FrameInfo } from '../../headless/video-scene';
|
|
4
4
|
import type { ActingRig } from '../acting/acting';
|
|
5
5
|
import { type PropRig, type SolvedProp } from './rig';
|
|
6
|
-
import { type PropDrawOptions } from './draw';
|
|
6
|
+
import { type LoosePart, type PropDrawOptions } from './draw';
|
|
7
7
|
import type { PropAction } from './script';
|
|
8
8
|
/**
|
|
9
9
|
* A prop: what it is, its rig, what it can do and how it acts. Families
|
|
@@ -92,7 +92,11 @@ export interface PropTarget extends CustomTarget {
|
|
|
92
92
|
/** px per metre */
|
|
93
93
|
readonly propScale: number;
|
|
94
94
|
readonly propDraw: Omit<PropDrawOptions, 'time' | 'rider'>;
|
|
95
|
+
/** Parts that have come loose as pieces (`propSurface().piece`): the piece's key in its props, by part id */
|
|
96
|
+
readonly loose?: Map<string, number>;
|
|
95
97
|
}
|
|
98
|
+
/** Where the loose parts have gone in this frame, from the `piece.K.*` values, by part id. */
|
|
99
|
+
export declare function loosePartsOf(target: PropTarget, values: Record<string, number>): Record<string, LoosePart> | undefined;
|
|
96
100
|
/** Every control a prop has, described: the common ones and its own. */
|
|
97
101
|
export declare function propControls(prop: Prop): Record<string, PropertyInfo & {
|
|
98
102
|
default?: number;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { CustomTarget } from '../adapters/canvas/canvas-adapter';
|
|
2
|
+
import type { Track } from '../engine/types';
|
|
3
|
+
import { type EditOptions } from './surface/edit-log';
|
|
4
|
+
import { type PropPresetName } from './props/presets';
|
|
5
|
+
import { type PropTarget } from './props/target';
|
|
6
|
+
/**
|
|
7
|
+
* Scenery behind the figures: a sky with the sun and moon on their arcs, stars
|
|
8
|
+
* at night, clouds drifting on the wind, rain that slants with it and snow
|
|
9
|
+
* that drifts, hills or a city on the horizon and the ground; or a room with
|
|
10
|
+
* a wall, a floor and a window on that sky. It is a canvas target whose
|
|
11
|
+
* values (`hour`, `clouds`, `wind`, `rain`, `snow`) are tracks, so a day
|
|
12
|
+
* passes and weather comes and goes as keyframes, and every frame is drawn
|
|
13
|
+
* from its time alone. `scenePreset` lays out a park, a street, an office or
|
|
14
|
+
* a home with it.
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* const sky = scenery({ x: 0, y: 0, width: 720, height: 400, hour: 9, clouds: 0.4, horizon: 'hills' })
|
|
18
|
+
* sky.set('hour', { at: 0, value: 20, duration: 12000 }) // a day passes
|
|
19
|
+
* sky.set('rain', { at: 5000, value: 0.8, duration: 1500 })
|
|
20
|
+
* const tracks = sky.tracks('sky')
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export type SceneryHorizon = 'hills' | 'city' | 'flat';
|
|
24
|
+
export interface SceneryOptions {
|
|
25
|
+
/** The backdrop's box, scene px */
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
/** Outdoors under a sky (default), or a room */
|
|
31
|
+
kind?: 'sky' | 'room';
|
|
32
|
+
/** Scene y of the ground line (default 85% of the way down the box) */
|
|
33
|
+
ground?: number;
|
|
34
|
+
/** Time of day, 0..24 (default 12): the sky's colours and where the sun and moon are */
|
|
35
|
+
hour?: number;
|
|
36
|
+
/** Cloud cover, 0..1 (default 0.3) */
|
|
37
|
+
clouds?: number;
|
|
38
|
+
/** Wind, −1..1 (default 0): clouds drift, rain slants, snow drifts; hair streams (see `hairFollow`) */
|
|
39
|
+
wind?: number;
|
|
40
|
+
/** Rain and snow, 0..1 (default 0) */
|
|
41
|
+
rain?: number;
|
|
42
|
+
snow?: number;
|
|
43
|
+
/** What is on the horizon (default hills outdoors) */
|
|
44
|
+
horizon?: SceneryHorizon;
|
|
45
|
+
/** A room: a window on the sky (default true) */
|
|
46
|
+
window?: boolean;
|
|
47
|
+
/** The particles' and the clouds' seed (default 1) */
|
|
48
|
+
seed?: number;
|
|
49
|
+
colors?: Partial<SceneryColors>;
|
|
50
|
+
}
|
|
51
|
+
export interface SceneryColors {
|
|
52
|
+
ground: string;
|
|
53
|
+
hills: string;
|
|
54
|
+
city: string;
|
|
55
|
+
cloud: string;
|
|
56
|
+
sun: string;
|
|
57
|
+
moon: string;
|
|
58
|
+
rain: string;
|
|
59
|
+
snow: string;
|
|
60
|
+
wall: string;
|
|
61
|
+
floor: string;
|
|
62
|
+
skirting: string;
|
|
63
|
+
frame: string;
|
|
64
|
+
}
|
|
65
|
+
export declare const SCENERY_COLORS: SceneryColors;
|
|
66
|
+
export interface Scenery {
|
|
67
|
+
readonly kind: 'scenery';
|
|
68
|
+
readonly target: CustomTarget;
|
|
69
|
+
/** Scene y of the ground line */
|
|
70
|
+
readonly ground: number;
|
|
71
|
+
/** Where a named place is at a time: `sun`, `moon`, `horizon`, `ground` (scene px; the sun and moon when up, else where they are below the horizon) */
|
|
72
|
+
anchor(name: 'sun' | 'moon' | 'horizon' | 'ground', time?: number): {
|
|
73
|
+
x: number;
|
|
74
|
+
y: number;
|
|
75
|
+
};
|
|
76
|
+
/** Change a value at a time: `hour`, `clouds`, `wind`, `rain`, `snow` */
|
|
77
|
+
set(prop: 'hour' | 'clouds' | 'wind' | 'rain' | 'snow', edit: EditOptions & {
|
|
78
|
+
value: number;
|
|
79
|
+
}): Scenery;
|
|
80
|
+
/** The recorded changes as tracks on `target` (the scenery's key in the scene) */
|
|
81
|
+
tracks(target: string): Track[];
|
|
82
|
+
}
|
|
83
|
+
/** The sky's colours at an hour. */
|
|
84
|
+
export declare function skyColors(hour: number): {
|
|
85
|
+
top: string;
|
|
86
|
+
bottom: string;
|
|
87
|
+
};
|
|
88
|
+
export declare function scenery(options: SceneryOptions): Scenery;
|
|
89
|
+
export type ScenePresetName = 'park' | 'street' | 'office' | 'home';
|
|
90
|
+
export interface ScenePresetOptions {
|
|
91
|
+
/** The scene's size, scene px */
|
|
92
|
+
width: number;
|
|
93
|
+
height: number;
|
|
94
|
+
/** Scene y of the ground (default 85% of the height) */
|
|
95
|
+
ground?: number;
|
|
96
|
+
/** Px per metre for the props (default: a quarter of the height per metre) */
|
|
97
|
+
scale?: number;
|
|
98
|
+
/** Overrides for the scenery (an hour, weather, colours) */
|
|
99
|
+
scenery?: Partial<SceneryOptions>;
|
|
100
|
+
}
|
|
101
|
+
/** A prop in a preset: which, where its middle stands (scene x), facing which way, with its scale. */
|
|
102
|
+
export interface PlacedProp {
|
|
103
|
+
preset: PropPresetName;
|
|
104
|
+
x: number;
|
|
105
|
+
turn?: number;
|
|
106
|
+
scale: number;
|
|
107
|
+
values?: Record<string, number>;
|
|
108
|
+
}
|
|
109
|
+
export interface ScenePreset {
|
|
110
|
+
scenery: SceneryOptions;
|
|
111
|
+
props: PlacedProp[];
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Ready-made scenes as plain data: the scenery and where the props stand, as
|
|
115
|
+
* shares of the width. A park under a late-morning sky with trees and a
|
|
116
|
+
* bench; a street at the end of the afternoon with houses, a car and a
|
|
117
|
+
* tree against the city; an office with a desk, a chair and a door; a home
|
|
118
|
+
* with a bed, a chair and a door.
|
|
119
|
+
*/
|
|
120
|
+
export declare function scenePreset(name: ScenePresetName | string, options: ScenePresetOptions): ScenePreset;
|
|
121
|
+
/** A preset built: its scenery target and its props as prop targets standing on the ground, in drawing order (left to right). */
|
|
122
|
+
export declare function buildScene(name: ScenePresetName | string, options: ScenePresetOptions): {
|
|
123
|
+
scenery: Scenery;
|
|
124
|
+
props: PropTarget[];
|
|
125
|
+
ground: number;
|
|
126
|
+
};
|
|
@@ -46,3 +46,20 @@ export declare function humanGag(name: HumanGagName, options: {
|
|
|
46
46
|
}): Array<CharacterPoseKey & {
|
|
47
47
|
pose: Pose;
|
|
48
48
|
}>;
|
|
49
|
+
/**
|
|
50
|
+
* Everyday actions as cycles, like a gait: the pose at `phase` (0 → 1 is one
|
|
51
|
+
* stroke and back), built on `base`. Sweeping holds a broom in both hands
|
|
52
|
+
* (`holding: { right: 'broom' }` draws it) and sweeps it side to side, the
|
|
53
|
+
* body turning a little with it; brushing works a hand across a surface in
|
|
54
|
+
* front at chest height (a wall, a window, a horse's flank).
|
|
55
|
+
*/
|
|
56
|
+
export declare function sweepingPose(phase: number, base?: Pose): Pose;
|
|
57
|
+
export declare function brushingPose(phase: number, base?: Pose): Pose;
|
|
58
|
+
/** The cycles by name, for `humanCyclePose`. */
|
|
59
|
+
export declare const HUMAN_CYCLES: {
|
|
60
|
+
readonly sweeping: typeof sweepingPose;
|
|
61
|
+
readonly brushing: typeof brushingPose;
|
|
62
|
+
};
|
|
63
|
+
export type HumanCycleName = keyof typeof HUMAN_CYCLES;
|
|
64
|
+
/** The pose of a named cycle at `phase` (0 → 1 is one stroke and back), built on `base`. */
|
|
65
|
+
export declare function humanCyclePose(name: HumanCycleName | string, phase: number, base?: Pose): Pose;
|
|
@@ -20,6 +20,8 @@ import type { BodyPlan, Pose } from '../rig/body-plan';
|
|
|
20
20
|
* - the face: `mouth`, `smile`, `mouthWidth`, `blink`, `eye.left`, `eye.right`,
|
|
21
21
|
* `brow.left`, `brow.right`, `browTilt`, `lookX`, `lookY` (as the v1 stick figure),
|
|
22
22
|
* and marks that fade in from 0 to 1: `blush` (cheeks), `tears`, `sweat` (a bead at the temple)
|
|
23
|
+
* - hair in motion: `hair.swing` (round the head toward its left +, degrees), `hair.trail`
|
|
24
|
+
* (streaming back +, head radii), `hair.lift` (up +, head radii); `hairFollow` keys them
|
|
23
25
|
* - `held.left`, `held.right`, `held.both`: whether what the character holds
|
|
24
26
|
* there shows (1, the default) or has been let go (below 0.5)
|
|
25
27
|
*
|
|
@@ -36,6 +38,8 @@ export interface HumanBuild {
|
|
|
36
38
|
legLength?: number;
|
|
37
39
|
/** Arm length, as a share of the standard (default 1) */
|
|
38
40
|
armLength?: number;
|
|
41
|
+
/** The feet's shape (default round) */
|
|
42
|
+
feet?: FootShape;
|
|
39
43
|
}
|
|
40
44
|
/**
|
|
41
45
|
* Ready-made builds: proportions only, so the same poses, gaits and actions
|
|
@@ -125,6 +129,7 @@ export declare const HUMAN_POSES: {
|
|
|
125
129
|
stretch: Pose;
|
|
126
130
|
sitFloor: Pose;
|
|
127
131
|
carry: Pose;
|
|
132
|
+
cane: Pose;
|
|
128
133
|
lift: Pose;
|
|
129
134
|
push: Pose;
|
|
130
135
|
pull: Pose;
|
|
@@ -135,6 +140,9 @@ export declare const HUMAN_POSES: {
|
|
|
135
140
|
};
|
|
136
141
|
export type HumanPoseName = keyof typeof HUMAN_POSES;
|
|
137
142
|
/** A human body plan; the same pose fields work on every build. */
|
|
143
|
+
/** The shape of the feet: round (the default), flat (a shoe), pointed (a slipper, an elf), or big (clown's feet). */
|
|
144
|
+
export type FootShape = 'round' | 'flat' | 'pointed' | 'big';
|
|
145
|
+
export declare const FOOT_SHAPES: readonly FootShape[];
|
|
138
146
|
export declare function humanPlan(build?: HumanBuild): BodyPlan;
|
|
139
147
|
/** Plain-language names for the human pose fields, for timelines and property panels. */
|
|
140
148
|
export declare function humanFieldLabel(field: string): string;
|
|
@@ -4,8 +4,9 @@ import type { CharacterLayers } from '../character';
|
|
|
4
4
|
* body's parts through the character's pen (so they match the look). The
|
|
5
5
|
* base is a top and trousers whose sleeves grow out of the shirt's shoulders
|
|
6
6
|
* with no seam; the options change its cut (long or no sleeves, shorts, a
|
|
7
|
-
* skirt) and add pieces worn over it (a collar, a tie, an apron, a lab coat
|
|
8
|
-
*
|
|
7
|
+
* skirt) and add pieces worn over it (a collar, a tie, an apron, a lab coat,
|
|
8
|
+
* a hoodie, a cardigan, overalls, a sari) and boots on the feet. The defaults
|
|
9
|
+
* are the original T-shirt and trousers, unchanged.
|
|
9
10
|
*/
|
|
10
11
|
export interface BasicOutfitOptions {
|
|
11
12
|
/** Shirt colour (default red) */
|
|
@@ -20,9 +21,19 @@ export interface BasicOutfitOptions {
|
|
|
20
21
|
collar?: boolean;
|
|
21
22
|
/** A tie down the front, in this colour */
|
|
22
23
|
tie?: string | null;
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Worn over the clothes (default none): an apron, a lab coat, a hoodie (a
|
|
26
|
+
* loose top with a hood at the back, a front pocket and long sleeves), a
|
|
27
|
+
* cardigan (open down the front, buttoned, long sleeves), overalls (a bib
|
|
28
|
+
* on the chest with straps over the shoulders, in the trousers' colour) or
|
|
29
|
+
* a sari (a drape to the ankles with the pallu over the near shoulder)
|
|
30
|
+
*/
|
|
31
|
+
over?: 'apron' | 'labCoat' | 'hoodie' | 'cardigan' | 'overalls' | 'sari' | null;
|
|
32
|
+
/** The colour of what is worn over (default: white coat, tan apron, grey hoodie, olive cardigan, green sari) */
|
|
26
33
|
overColor?: string;
|
|
34
|
+
/** On the feet: nothing (default), or boots to above the ankle */
|
|
35
|
+
shoes?: 'none' | 'boots';
|
|
36
|
+
/** The boots' colour (default dark brown) */
|
|
37
|
+
shoeColor?: string;
|
|
27
38
|
}
|
|
28
39
|
export declare function basicOutfit(options?: BasicOutfitOptions): CharacterLayers;
|
|
@@ -36,7 +36,7 @@ import { type SurfaceBox } from './surface/surface-box';
|
|
|
36
36
|
* `mark.ID.draw`, `strike.K.draw`, `piece.K.x`…) and written out by
|
|
37
37
|
* `tracks()`.
|
|
38
38
|
*/
|
|
39
|
-
export type BoardThemeName = 'whiteboard' | 'chalkboard';
|
|
39
|
+
export type BoardThemeName = 'whiteboard' | 'chalkboard' | 'lines';
|
|
40
40
|
export interface BoardTheme {
|
|
41
41
|
background: string;
|
|
42
42
|
frame: string;
|
|
@@ -49,6 +49,12 @@ export interface BoardTheme {
|
|
|
49
49
|
stroke: number;
|
|
50
50
|
/** Ink opacity (chalk is a little see-through) */
|
|
51
51
|
opacity: number;
|
|
52
|
+
/** Ruled paper: the lines' colour, their spacing (em of the font size) and a margin line's colour */
|
|
53
|
+
rule?: {
|
|
54
|
+
color: string;
|
|
55
|
+
spacing?: number;
|
|
56
|
+
margin?: string;
|
|
57
|
+
};
|
|
52
58
|
}
|
|
53
59
|
export declare const BOARD_THEMES: Record<BoardThemeName, BoardTheme>;
|
|
54
60
|
/** The marks a board can draw. */
|
|
@@ -76,6 +82,12 @@ export interface BoardMark {
|
|
|
76
82
|
/** `arrow`: from one place to another */
|
|
77
83
|
from?: string;
|
|
78
84
|
to?: string;
|
|
85
|
+
/**
|
|
86
|
+
* `arrow`: how far it bows, as a fraction of its length (+ bows to the left of
|
|
87
|
+
* the way it points, − to the right). Default: a slight hand-drawn bow, or
|
|
88
|
+
* round any text it would cross.
|
|
89
|
+
*/
|
|
90
|
+
bend?: number;
|
|
79
91
|
color?: string;
|
|
80
92
|
/** Start undrawn, to be drawn in with the `draw` edit */
|
|
81
93
|
hidden?: boolean;
|