@fabi-play/engine 0.2.0 → 0.4.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/dist/fabi-play-engine.d.ts +17 -9
- package/dist/fabi-play-engine.js +13 -13
- package/dist/fabi-play-engine.lite.d.ts +17 -9
- package/dist/fabi-play-engine.lite.js +5 -5
- package/dist/fabi-play-engine.lite.umd.js +5 -1
- package/dist/fabi-play-engine.lite.umd.min.js +2 -2
- package/dist/fabi-play-engine.umd.js +267 -25
- package/dist/fabi-play-engine.umd.min.js +13 -13
- package/dist/index.d.ts +17 -9
- package/dist/index.development.js +4 -0
- package/dist/index.js +5 -5
- package/dist/integrity.json +9 -9
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -56,7 +56,9 @@ export type Backdrop = "video" | "none";
|
|
|
56
56
|
* image is cropped to fill the screen), with any backdrop, so avatars and hands are where the children stand (a
|
|
57
57
|
* "virtual mirror"). The screen decides it: with 'video', where the video is drawn (cover or contain); with 'none',
|
|
58
58
|
* the whole image contained at 92% of the viewport's height, bottom-aligned. Games don't compute it: they just use
|
|
59
|
-
* it.
|
|
59
|
+
* it. It is not fixed: with automatic framing (the default, see GameManifest.framing) the screen zooms in on children
|
|
60
|
+
* standing far away, up to 1.8×, so the image may reach past every edge; it changes only at calibration and in breaks
|
|
61
|
+
* (pause, level, turn), never during play, and arrives in a backdrop message. Body points are in player space (0–1 of the camera image, already mirrored like the video), so a point p is on
|
|
60
62
|
* screen at (x + p.x·w, y + p.y·h): see toScreen.
|
|
61
63
|
*/
|
|
62
64
|
export interface BackdropView {
|
|
@@ -1874,21 +1876,21 @@ export interface Palette {
|
|
|
1874
1876
|
hair?: string;
|
|
1875
1877
|
}
|
|
1876
1878
|
/** The head's outline. */
|
|
1877
|
-
export type HeadShape = "round" | "wide" | "tall" | "square" | "bulb" | "bucket";
|
|
1879
|
+
export type HeadShape = "round" | "wide" | "tall" | "square" | "bulb" | "bucket" | "snout-long";
|
|
1878
1880
|
/** The ears (or what is in their place: horns, antennae, a fin). */
|
|
1879
|
-
export type EarKind = "none" | "pointy" | "round" | "big-round" | "long" | "side" | "tufts" | "antenna" | "antennae" | "horns" | "unicorn" | "floppy" | "droopy" | "fin" | "human";
|
|
1881
|
+
export type EarKind = "none" | "pointy" | "round" | "big-round" | "long" | "side" | "tufts" | "antenna" | "antennae" | "horns" | "unicorn" | "floppy" | "droopy" | "fin" | "human" | "pixie";
|
|
1880
1882
|
/** How the eyes are drawn. */
|
|
1881
1883
|
export type EyeKind = "dot" | "big" | "mask" | "screen" | "almond" | "visor" | "calm" | "slit" | "goggle" | "bead";
|
|
1882
1884
|
/** How the mouth (or beak) is drawn. */
|
|
1883
|
-
export type MouthKind = "none" | "smile" | "open" | "cat" | "beak" | "teeth" | "grill" | "tiny" | "smirk" | "bill" | "hook" | "jaws";
|
|
1885
|
+
export type MouthKind = "none" | "smile" | "open" | "cat" | "beak" | "teeth" | "grill" | "tiny" | "smirk" | "bill" | "hook" | "jaws" | "toothy";
|
|
1884
1886
|
/** The patch around the nose and mouth. */
|
|
1885
1887
|
export type MuzzleKind = "none" | "oval" | "heart" | "monkey" | "disc" | "cheeks" | "band";
|
|
1886
1888
|
/** The tail, behind the body. */
|
|
1887
|
-
export type TailKind = "none" | "fluffy" | "brush" | "pom" | "long" | "curl" | "tuft" | "striped" | "spiky" | "arrow" | "fish" | "plume";
|
|
1889
|
+
export type TailKind = "none" | "fluffy" | "brush" | "pom" | "long" | "curl" | "tuft" | "striped" | "spiky" | "arrow" | "fish" | "plume" | "thick";
|
|
1888
1890
|
/** Things on the head. */
|
|
1889
|
-
export type HeadExtra = "mane" | "rainbow-mane" | "stripes" | "spikes" | "spots" | "curl" | "helmet" | "bolts" | "whiskers" | "tuft" | "brows" | "eggshell" | "wool" | "eye-spot" | "crest" | "forehead" | "gills" | "ruff" | "hair" | "curls" | "locks" | "ninja-hood" | "cap" | "safari-hat" | "wizard-hat" | "plume" | "stripe" | "bandana" | "eye-patch" | "dive-mask" | "domino";
|
|
1891
|
+
export type HeadExtra = "mane" | "rainbow-mane" | "stripes" | "spikes" | "spots" | "curl" | "helmet" | "bolts" | "whiskers" | "tuft" | "brows" | "eggshell" | "wool" | "eye-spot" | "crest" | "forehead" | "gills" | "ruff" | "hair" | "curls" | "locks" | "ninja-hood" | "cap" | "safari-hat" | "wizard-hat" | "plume" | "stripe" | "bandana" | "eye-patch" | "dive-mask" | "domino" | "bun" | "flower-crown";
|
|
1890
1892
|
/** Things on the body. */
|
|
1891
|
-
export type BodyExtra = "wings" | "backpack" | "sheet" | "tentacles" | "panel" | "badge" | "joints" | "feathers" | "flippers" | "boots" | "scarf" | "spots" | "wool" | "robe" | "cape" | "fins" | "tank" | "straps" | "belt" | "stripes" | "pauldrons" | "emblem" | "pocket" | "racing-stripe" | "star";
|
|
1893
|
+
export type BodyExtra = "wings" | "backpack" | "sheet" | "tentacles" | "panel" | "badge" | "joints" | "feathers" | "flippers" | "boots" | "scarf" | "spots" | "wool" | "robe" | "cape" | "fins" | "tank" | "straps" | "belt" | "stripes" | "pauldrons" | "emblem" | "pocket" | "racing-stripe" | "star" | "tiny-arms" | "strong-legs" | "wings-fairy" | "wand" | "petals";
|
|
1892
1894
|
/** An avatar's face. */
|
|
1893
1895
|
export interface FaceDef {
|
|
1894
1896
|
/** How the eyes are drawn. */
|
|
@@ -1922,10 +1924,16 @@ export interface AvatarDef {
|
|
|
1922
1924
|
it: string;
|
|
1923
1925
|
};
|
|
1924
1926
|
/**
|
|
1925
|
-
* The age band the avatar is for: its style and its body proportions (see BAND_BODY in rig.ts). 'all': in
|
|
1926
|
-
* band's list, drawn with the 6–8 proportions.
|
|
1927
|
+
* The age band the avatar is for, its home: its style and its body proportions (see BAND_BODY in rig.ts). 'all': in
|
|
1928
|
+
* every band's list, drawn with the 6–8 proportions. See alsoIn for an avatar offered in other bands too.
|
|
1927
1929
|
*/
|
|
1928
1930
|
band: AvatarBand;
|
|
1931
|
+
/**
|
|
1932
|
+
* Other age bands the avatar is also offered in (listed in their AVATAR_BANDS too), besides its own band. Shown in
|
|
1933
|
+
* one of them, it is drawn with that band's proportions (bodyBand(def, band)); its band stays its home: its style
|
|
1934
|
+
* (outline), bandOf, and its proportions when the band shown is not known. Not for 'all' (the mascot).
|
|
1935
|
+
*/
|
|
1936
|
+
alsoIn?: readonly AgeRange[];
|
|
1929
1937
|
/** A special avatar (the mascot): first in every band's list; pickers may mark it. */
|
|
1930
1938
|
special?: boolean;
|
|
1931
1939
|
/** Its colours. */
|
|
@@ -5176,6 +5176,10 @@ async function createEngine(opts = {}) {
|
|
|
5176
5176
|
};
|
|
5177
5177
|
unlisten.push(
|
|
5178
5178
|
play.on("start", (m) => lateHint(m?.device)),
|
|
5179
|
+
// The simple API knows muted only from the start (its getter is false before): read it again then.
|
|
5180
|
+
play.on("start", (m) => {
|
|
5181
|
+
if (typeof m?.muted === "boolean") sound.muted = m.muted;
|
|
5182
|
+
}),
|
|
5179
5183
|
play.on("frame", (m) => setPlayers(m?.players)),
|
|
5180
5184
|
play.on("players", (m) => setPlayers(m?.players)),
|
|
5181
5185
|
play.on("backdrop", (m) => setBackdrop(m?.backdrop, m?.view)),
|