https://github.com/dawee/pixon
Run Pixi.js games offline
https://github.com/dawee/pixon
Last synced: 3 months ago
JSON representation
Run Pixi.js games offline
- Host: GitHub
- URL: https://github.com/dawee/pixon
- Owner: dawee
- Created: 2017-05-05T13:28:25.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-05T13:32:48.000Z (about 9 years ago)
- Last Synced: 2025-07-09T23:35:58.775Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pixon
Run Pixi.js games offline
## Usage
First install pixi.js and pixon
```sh
npm install --save pixi.js pixon
```
Fill your index.js with some Pixi.js code
```js
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 :
```json
{
"scripts": {
"start": "pixon"
}
}
```
Then, run :
```sh
npm start
```