text: import phaser from 'phaser/src/phaser.js';
  import TransitionImagePlugin from '../../plugins/transitionimage-plugin';
  
  class Demo extends Phaser.Scene {
      constructor() {
          super({
              key: 'examples'
          })
      }
  
      preload() {
          this.load.image('classroom', 'assets/images/backgrounds/classroom.png');
          this.load.image('road', 'assets/images/backgrounds/road.png');
      }
  
      create() {
          // Default transition behavior is cross-fade
          var image = this.add.rexTransitionImage(400, 300, 'classroom')
              .on('complete', function () {
                  console.log('complete')
              })
  
          this.input.on('pointerdown', function () {
              var currentKey = image.texture.key;
              if (currentKey === 'classroom') {
                  image.transit('road');
              } else {
                  image.transit('classroom');
              }
  
          })
  
      }
  
      update() { }
  }
  
  var config = {
      type: Phaser.AUTO,
      parent: 'phaser-example',
      width: 800,
      height: 600,
      scale: {
          mode: Phaser.Scale.FIT,
          autoCenter: Phaser.Scale.CENTER_BOTH,
      },
      scene: Demo,
      plugins: {
          global: [{
              key: 'rexTransitionImage',
              plugin: TransitionImagePlugin,
              start: true
          }]
      }
  };
  
  var game = new Phaser.Game(config);