These are chat archives for pixijs/pixi.js

17th
Jun 2015
Omar Juarez
@omarojo
Jun 17 2015 00:18
Hey Hi. do anyone has a sample that I can use for scene management in Pixi, I see all the demos are dump into 1 file, but how would you separate the game into files for better development? like Phaser with its states mechanism.
Endel Dreyer
@endel
Jun 17 2015 01:40

Hey @omarojo, you may use a Container for your "stage", and other custom Containers for each scene - managing transitions manually (via addChild/removeChild). I like to use ES6 syntax which is friendlier.

Example:

class Scene extends PIXI.Container {
  constructor() {
    super();

    // setup your scene here
    this.addChild(...)
  }
}

var stage = new PIXI.Container()

var myScene = new Scene();
stage.addChild(myScene)
Omar Juarez
@omarojo
Jun 17 2015 02:28
I see.. is ES6 final ? I was going to follow that format before but looking for tutorials on ES6 OOP format I found a lot of different implementations and then people contradicting others saying that some formats were not supported anymore in ES6 like the way you declare private and public properties/functions etc... so then I could trust anybody :(
Chad Engler
@englercj
Jun 17 2015 13:02
ES6 is set to be released this month, as for when it is in browsers who knows. private/public keywords are implemented in Typescript, but not JS