Pixel Studio

Agents describe characters; the engine draws them as pixel art at every level of detail; websites play them with one tag.

npm i @pixel-studio/core

Documentation

  • Guide

    Describe a character as JSON; the engine draws it as pixel art at every size, with realistic motion; one tag plays it on any web page, where it can even walk around your layout. Every example on these pages is live: the code under each one is exactly what runs.

    8 pages

  • Reference

    Write a character, make it move and put it on a page: the spec, figures, runtime, stage, CLI and API.

    10 pages

  • Project

    The README, what changed in each release, and how to contribute.

    2 pages

Five minutes to a goose on your page

  1. Install

    npm i @pixel-studio/core   # the engine and CLI; brings @pixel-studio/runtime with it
  2. Make a character by changing an example (my-goose.json)

    { "extends": "./node_modules/@pixel-studio/core/examples/goose-base.json",
      "name": "Marigold",
      "materials": { "feather": { "color": "#e8b04a" }, "beak": { "color": "#d94b32" } } }
  3. Run npx pixel validate, preview and bundle

    npx pixel validate my-goose.json                          # errors with JSON paths and did-you-mean
    npx pixel preview  my-goose.json --out my-goose.png       # every animation at 16, 32 and 64 px
    npx pixel bundle   my-goose.json --out my-goose.bundle.json
  4. Put it on a page with @pixel-studio/runtime

    A site that only plays sprites needs just the runtime: npm i @pixel-studio/runtime, no dependencies.

    <script type="module" src="node_modules/@pixel-studio/runtime/src/pixel-sprite.js"></script>
    <pixel-sprite src="my-goose.bundle.json" anim="idle" size="128" hover-anim="waddle" click-anim="honk"></pixel-sprite>