node-pixi
Run PIXI.js on node.
Headless WebGL rendering is enabled through the GL package.
To force canvas rendering:
const app = forceCanvas: true;
image output
Call app.view.toBuffer()
to get a node Buffer
.
Supported formats:
- jpg
- png
- svg
// toBuffer returns a Promise // JPEG: (second argument specifies quality, value in range 0 to 1)appview; // PNG:appview; // or simply use without argumentsappview; // PDF:appview; // SVG:appview;
example
;; const app = backgroundColor: 0xff0000; PIXIloader; PIXIloaderonComplete; PIXIloaderonError; PIXIloader;