@fabi-play/engine 0.3.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/index.d.ts CHANGED
@@ -1876,21 +1876,21 @@ export interface Palette {
1876
1876
  hair?: string;
1877
1877
  }
1878
1878
  /** The head's outline. */
1879
- export type HeadShape = "round" | "wide" | "tall" | "square" | "bulb" | "bucket";
1879
+ export type HeadShape = "round" | "wide" | "tall" | "square" | "bulb" | "bucket" | "snout-long";
1880
1880
  /** The ears (or what is in their place: horns, antennae, a fin). */
1881
- 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";
1882
1882
  /** How the eyes are drawn. */
1883
1883
  export type EyeKind = "dot" | "big" | "mask" | "screen" | "almond" | "visor" | "calm" | "slit" | "goggle" | "bead";
1884
1884
  /** How the mouth (or beak) is drawn. */
1885
- 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";
1886
1886
  /** The patch around the nose and mouth. */
1887
1887
  export type MuzzleKind = "none" | "oval" | "heart" | "monkey" | "disc" | "cheeks" | "band";
1888
1888
  /** The tail, behind the body. */
1889
- 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";
1890
1890
  /** Things on the head. */
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";
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";
1892
1892
  /** Things on the body. */
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";
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";
1894
1894
  /** An avatar's face. */
1895
1895
  export interface FaceDef {
1896
1896
  /** How the eyes are drawn. */
@@ -1924,10 +1924,16 @@ export interface AvatarDef {
1924
1924
  it: string;
1925
1925
  };
1926
1926
  /**
1927
- * The age band the avatar is for: its style and its body proportions (see BAND_BODY in rig.ts). 'all': in every
1928
- * 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.
1929
1929
  */
1930
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[];
1931
1937
  /** A special avatar (the mascot): first in every band's list; pickers may mark it. */
1932
1938
  special?: boolean;
1933
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)),