Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flo-bit/pixi-three-scaffold
https://github.com/flo-bit/pixi-three-scaffold
javascript js pixi scaffold threejs
Last synced: 15 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/flo-bit/pixi-three-scaffold
- Owner: flo-bit
- Created: 2023-02-01T16:53:14.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-15T17:00:49.000Z (almost 2 years ago)
- Last Synced: 2024-12-16T11:36:27.834Z (18 days ago)
- Topics: javascript, js, pixi, scaffold, threejs
- Language: JavaScript
- Homepage: https://flo-bit.github.io/pixi-three-scaffold/
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# PIXI+THREE scaffold
This is a scaffold for PIXI.js + THREE.js projects (combining 3d and 2d rendering).
includes:
- import of PIXI.js and THREE.js
- main pixi app with a root container and a canvas
- adds an offscreen canvas for THREE.js and a PIXI.js texture of that canvas (pixi texture is added to root container)
- automatic resizing of root container (fixed size) and canvas to window size
- keydown and keyup events
- setup and update functionssee [flo-bit.github.io/pixi-three-scaffold/](https://flo-bit.github.io/pixi-three-scaffold/) for a simple example.
## Usage
- import the `pixi-scaffold` module
```js
import PixiThreeScaffold from "https://flo-bit.github.io/pixi-scaffold/pixi-three-scaffold.js";
```- make a game class with a `setup` and `update` function
```js
class Game {
setup(app) {
// setup your game here
}
update(delta, total, app) {
// update your game here
}
}
```- call `PixiThreeScaffold.run` and pass an instance of the game class
```js
PixiThreeScaffold.run(new Game());
```