Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

phaser-plugin-scene-watcher

samme119ISC7.0.0

Scene monitoring and debugging for Phaser 3

phaser, phaser3, phaser-plugin, phaser3-plugin

readme

Screenshot

Phaser 3 Scene Watcher Plugin

For each scene, it shows (left to right):

  1. key
  2. status
  3. display list count
  4. update list count
  5. active (a)
  6. visible (v)
  7. transitioning (t)
  8. input active (i)
  9. keyboard input active (k)

See the demo or Cavern Quest.

Browser / UMD

<script src="https://cdn.jsdelivr.net/npm/phaser-plugin-scene-watcher@7.0.0/dist/phaser-plugin-scene-watcher.umd.js"></script>

Use the global PhaserSceneWatcherPlugin.

/* global PhaserSceneWatcherPlugin */

new Phaser.Game({
  plugins: {
    global: [
      { key: 'SceneWatcher', plugin: PhaserSceneWatcherPlugin, start: true }
    ]
  },
});

Module

Install phaser-plugin-scene-watcher from npm and use the default import:

import SceneWatcherPlugin from 'phaser-plugin-scene-watcher';

new Phaser.Game({
  plugins: {
    global: [
      { key: 'SceneWatcher', plugin: SceneWatcherPlugin, start: true }
    ]
  },
});

Quick load

function preload () {
  this.load.plugin('PhaserSceneWatcherPlugin', 'https://cdn.jsdelivr.net/npm/phaser-plugin-scene-watcher@7.0.0/dist/phaser-plugin-scene-watcher.umd.js', true);
}

Log scene events to console

watchAll() starts logging scene events for all existing scenes. Call it once after all scenes are added.

From the game configuration:

new Phaser.Game({
  callbacks: {
    postBoot: function (game) {
      // Use the `key` you added the plugin with.
      game.plugins.get('SceneWatcher').watchAll();
    }
  }
});

From a scene:

function init () {
  // Use the `key` you added the plugin with.
  this.plugins.get('SceneWatcher').watchAll();
}

changelog

7.0.0

  • Removed pre-ES2015 support.

6.0.0

  • Changed console output from log(), to info(), so it's easier to filter out.
  • Changed the order of console output to event, key.

5.0.1

  • Fixed an error when a scene had custom plugin mappings.
  • Fixed an error when a scene had no input plugin.

5.0.0

  • Removed the main (CommonJS) script. You can still use the UMD script as a CommonJS import if you need to.

4.2.0

  • Added column for scene transitioning.

4.1.0

  • Added columns for scene active, visible, input enabled, and keyboard enabled.
  • Added print() method. It prints the table output to the console.
  • Resized the columns.

4.0.0

  • There are now three script endpoints for browser (UMD), module (ES), and main (CommonJS).
  • The global PhaserSceneWatcherPlugin is now available only when using the browser/UMD script.

3.2.2

  • Fixed an error reading the update list length in Phaser v3.20.

3.2.1

  • Changed Phaser to a peer dependency.

3.2.0

  • Moved the scene status icon to the left.

3.1.4

  • Reverted Phaser dependency to ^3.16.2.

3.1.3

  • Updated dist script. It was omitted from v3.1.0 by mistake.

3.1.0

  • Reduced transparency.
  • Reversed the order of arguments when logging scene events. Scene key is now first.
  • Updated Phaser dependency to 3.17.0.

3.0.1

  • Updated Phaser dependency to 3.16.2 (required since plugin v3.0.0).

3.0.0

  • Changed 'main' script to src/index.js.
  • Added scene transition events.

2.2.0

  • Added scene 'create' event.

2.1.0

  • View is updated only when output changes.

2.0.0

  • Added global PhaserSceneWatcherPlugin.
  • Removed Phaser.Plugin.SceneWatcher. Use PhaserSceneWatcherPlugin instead.
  • Renamed dist script to dist/PhaserSceneWatcherPlugin.js.
  • Renamed src script to src/index.js.

1.0.1

  • Removed extra files from npm module.

1.0.0

  • npm release.