npm.io
0.7.0 • Published 1 month ago

@yagejs/renderer

Licence
MIT
Version
0.7.0
Deps
2
Size
1.2 MB
Vulns
0
Weekly
0

@yagejs/renderer

PixiJS v8 rendering pipeline, sprites, graphics, and cameras for the YAGE 2D game engine.

Install

npm install @yagejs/renderer

Bundles PixiJS v8 - no separate install required.

Usage

import { Engine } from "@yagejs/core";
import { RendererPlugin, SpriteComponent, GraphicsComponent } from "@yagejs/renderer";

const engine = new Engine();
engine.use(new RendererPlugin({
  width: 800,
  height: 600,
  backgroundColor: 0x0a0a0a,
  container: document.getElementById("game")!,
}));
await engine.start();

What's in the box

  • RendererPlugin - boots PixiJS, registers stage/camera/layers
  • SpriteComponent / AnimatedSpriteComponent - static and animated sprites
  • GraphicsComponent - vector drawing via PixiJS Graphics
  • Camera - follow, shake, bounds, virtual resolution scaling
  • RenderLayer - named layers with z-ordering
  • Texture helpers - texture(), spritesheet(), sliceSheet() for assets

Docs

Full documentation at yage.dev.

License

MIT

Keywords