Quickstart
Quickstart
Optional Zdog avatar renderer and portable scene authoring
This illustrative example installs the bundled mushroom as a local character and renders it with the Sprite React component:
import { createSprite } from "@fungi.computer/sprite";import { Sprite } from "@fungi.computer/sprite/react";import { builtinCharacters } from "@fungi.computer/sprite-zdog";
const service = createSprite({ characters: builtinCharacters,});
function Character() { return ( <Sprite service={service} src={{ local: "mushroom" }} activity="thinking" role="img" aria-label="Mushroom character" /> );}builtinCharacters provides lazy mushroom, cat and burger loaders without
remote asset access. The bundled character supplies its document and Zdog
renderer together. The tests cover built-in characters and player integration in
src/builtins.test.ts and
src/mushroom.test.ts.