/*
 * Intro state
 *
 * Shows the intro
 */


export default class Intro extends Phaser.State {
  init () {
    // TODO: Stub
  }

  preload () {
    // TODO: Stub
  }

  create () {
    // TODO: Stub
  }

  update () {
    // TODO: Stub
  }

  render () {
    // TODO: Stub
  }

  create () {
    var x = this.game.width / 2;
    var y = this.game.height / 2;

    this.game.stage.backgroundColor = '#62788A';

    console.log('hier');
    console.log(x, y);

    var style = { font: "65px Arial", fill: "#ffffff", align: "center" };

    // background
    this.menu_background = this.add.sprite(90,60,'title');
    this.menu_background.fixedToCamera = true;
    // this.menu_background.blendMode = PIXI.blendModes.SCREEN;

    // title
    var style_press = { font: "italic 23px Arial", fill: "#ffffff", align: "center" };
    var style_subtitle = { font: "italic 32px Audiowide", fill: "#ffffff", align: "center" };
    var style_sub = { font: "italic 18px Audiowide", fill: "#999999", align: "center" };

    //this.title = this.add.text(x, y - 250, "Run Fonster, Run!", style);
    //this.title.anchor.set(0.5);


    this.text = this.add.text(x - 70, y +200, "Click to Start", style_press);

    // this.input.onDown.add(this.onDown, this);

    console.log("jo");

    this.input.onDown.add(this.onDown, this);

  }

  onDown () {
    this.state.start('Game');
  }

  update () {
      // this.logo.an gle += 0.1;
    // this.state.start('Intro');
  }

}
