[READ-ONLY] Mirror of https://github.com/flo-bit/pixi-three-scaffold. flo-bit.github.io/pixi-three-scaffold/
javascript js pixi scaffold threejs
0

Configure Feed

Select the types of activity you want to include in your feed.

JavaScript 56.9%
HTML 43.1%
9 1 0

Clone this repository

https://tangled.org/flo-bit.dev/pixi-three-scaffold https://tangled.org/did:plc:qdjgmv2zpszwpvl2io73py37
git@tangled.org:flo-bit.dev/pixi-three-scaffold git@tangled.org:did:plc:qdjgmv2zpszwpvl2io73py37

For self-hosted knots, clone URLs may differ based on your setup.



Readme.md

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 functions

see flo-bit.github.io/pixi-three-scaffold/ for a simple example.

Usage#

  • import the pixi-scaffold module
import PixiThreeScaffold from "https://flo-bit.github.io/pixi-scaffold/pixi-three-scaffold.js";
  • make a game class with a setup and update function
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
PixiThreeScaffold.run(new Game());