text: import Phaser from 'phaser'
  import WebFont from 'webfontloader'
  import config from '../config'
  
  export default class extends Phaser.State {
    init () {
      this.game.scale.pageAlignHorizontally = true;
      this.game.scale.pageAlignVertically = true;
      this.game.scale.refresh();
      this.stage.backgroundColor = '#000'
      this.fontsReady = false
      this.fontsLoaded = this.fontsLoaded.bind(this)
    }
  
    preload () {
      WebFont.load({
        google: {
          families: ['Belgrano']
        },
        active: this.fontsLoaded
      });
  
      let text = this.add.text(this.world.centerX, this.world.centerY, 'loading...', { font: '16px Arial', fill: '#aaaaaa', align: 'center' })
      text.anchor.setTo(0.5, 0.5)
  
      this.load.image('loaderBg', './assets/images/loader-bg.png')
      this.load.image('loaderBar', './assets/images/loader-bar.png')
  
      var state = JSON.stringify(config.state);
      config.initial_state = state;
      this.time = 1.0;
    }
  
    render () {
      var dt = this.game.time.physicsElapsed;
      this.time -= dt;
      if (this.time < 0.0) {
        this.state.start('Splash')
      }
    }
  
    fontsLoaded () {
      this.fontsReady = true
    }
  }
  