Skip to content

Sprite

Sprite shows an animated character in your web app or game, through a renderer you install, so you never write your own rendering layer for an avatar.

  • @fungi.computer/sprite
  • v0.2.0
  • MIT

Fastest path

  1. Install

    Add it to your project with npm, pnpm, Yarn or Bun.

    TERMINAL
    npm install @fungi.computer/sprite react
  2. Check a saved avatar

    Builds the default mushroom avatar and validates it against Sprite's envelope schema. Pure data; no renderer or browser needed.

    home.ts
    import {
    avatarEnvelopeSchema,
    seededAvatar,
    } from "@fungi.computer/sprite/avatar";
    const avatar = seededAvatar("agent-42");
    console.log(avatar.character, avatar.expression); // "mushroom" "normal"
    console.log(avatarEnvelopeSchema.safeParse(avatar).success); // true
    console.log(avatarEnvelopeSchema.safeParse({ v: 2 }).success); // false