pixfx

pixfx

Pixel-art effects written once in Rust. Render them to sprite sheets, or play the same effects live in the browser, Phaser and gpui. Every spell in the duel above is one of them.

The duel above is drawn live by the engine, every frame.

Where it runs

Pick the layer that fits your project. All of them share one engine and one effect registry.

Write a sprite sheet (composite, colour and light PNGs plus beanfx-layout JSON), or a looping GIF.

cargo run -p pixfx-export --example sprite_sheet -- fire/campfire --out out
cargo run -p pixfx-export --example gif -- fire/campfire --scale 4 --out out

Scripts ยท Sprite sheet format

Try it in a minute

  1. Clone the repository. rust-toolchain.toml pins the nightly and the wasm target, so rustup fetches them on first build.

  2. Render the campfire to a GIF:

    cargo run -p pixfx-export --example gif -- fire/campfire --out out
  3. Or play it in the browser through the Canvas 2D demo:

    cd packages/pixfx-web && bun install && bun run build:wasm
    cd ../pixfx-canvas2d && bun install && bunx vite demo

Full getting-started guide