1.0.0 • Published 7 years ago

pixon v1.0.0

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

Pixon

Run Pixi.js games offline

Usage

First install pixi.js and pixon

npm install --save pixi.js pixon

Fill your index.js with some Pixi.js code

const { Application, Sprite } = require('pixi.js');


const app = new Application(800, 600, { backgroundColor : 0x1099bb });
const bunny = Sprite.fromImage('assets/bunny.png');


bunny.anchor.set(0.5);
bunny.x = app.renderer.width / 2;
bunny.y = app.renderer.height / 2;

app.stage.addChild(bunny);
app.ticker.add((delta) => bunny.rotation += 0.1 * delta);

module.exports = app;

Add assets/bunny.png in your project.

Add pixon in your start script :

{
  "scripts": {
    "start": "pixon"
  }
}

Then, run :

npm start