PixiJS — The HTML5 Creation Engine
The aim of this project is to provide a fast lightweight 2D library that works
across all devices. The PixiJS renderer allows everyone to enjoy the power of
hardware acceleration without prior knowledge of WebGL. Also, it's fast. Really fast.
We are now a part of the Open Collective and with your support you can help us make PixiJS even better. To make a donation, simply click the button below and we'll love you forever!
This package is the same as pixi.js, but provides fallback support for browsers that do not support WebGL or more modern JavaScript features.
Setup
PixiJS can be installed with npm to integrate with Webpack, Browserify, Rollup, Electron, NW.js or other module backed environments.
Install
npm install pixi.js-legacy
There is no default export. The correct way to import PixiJS is:
import * as PIXI from 'pixi.js-legacy'
Basic Usage Example
import { Application, Assets, Sprite } from 'pixi.js-legacy';
const app = new Application();
document.body.appendChild(app.view);
const texture = await Assets.load('bunny.png');
const bunny = new Sprite(texture);
bunny.x = app.renderer.width / 2;
bunny.y = app.renderer.height / 2;
bunny.anchor.x = 0.5;
bunny.anchor.y = 0.5;
app.stage.addChild(bunny);
app.ticker.add(() => {
bunny.rotation += 0.01;
});
License
This content is released under the (http://opensource.org/licenses/MIT) MIT License.