class fullButton extends Phaser.GameObjects.Image {
  constructor(scene, x, y, texture,doc) {
    super(scene, x, y, texture);
    var that = this
    that.setInteractive({ useHandCursor: true })
      .on('pointerover', () => that.enterButtonHoverState() )
      .on('pointerout', () => that.enterButtonRestState() )
      .on('pointerdown', () => that.enterButtonActiveState() )
      .on('pointerup', () => {
        that.enterButtonHoverState();
        var el = document.getElementById(doc);
        if(document.fullscreenElement == null){
          try{
            el.requestFullScreen()
            consle.log('here')
          }
          catch{
            try{
              el.webkitRequestFullScreen()
              console.log('here')
            }
            catch{
              el.mozRequestFullScreen()
              console.log('here')
            }
          }
        }
        else if(document.fullscreenElement != null){
          try{
            document.exitFullscreen()
            consle.log('here')
          }
          catch{
            try{
              document.webkitExitFullscreen()
              console.log('here')
            }
            catch{
              document.mozExitFullscreen()
              console.log('here')
            }
          }
        }
      });
  }
  enterButtonHoverState() {
    this.setTint(505050);
  }

  enterButtonRestState() {
    this.clearTint();
  }

  enterButtonActiveState() {
    this.setTint(252525);
  }
}