Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/samme/phaser-plugin-scene-watcher
Scene monitoring and debugging for Phaser 3
https://github.com/samme/phaser-plugin-scene-watcher
phaser phaser-plugin phaser3 phaser3-plugin
Last synced: 4 months ago
JSON representation
Scene monitoring and debugging for Phaser 3
- Host: GitHub
- URL: https://github.com/samme/phaser-plugin-scene-watcher
- Owner: samme
- Created: 2018-05-31T20:38:57.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-30T23:29:17.000Z (7 months ago)
- Last Synced: 2024-09-28T14:02:06.262Z (4 months ago)
- Topics: phaser, phaser-plugin, phaser3, phaser3-plugin
- Language: JavaScript
- Homepage: https://codepen.io/samme/pen/VBbJZM
- Size: 934 KB
- Stars: 27
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
![Screenshot](./preview.png)
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](https://newdocs.phaser.io/docs/3.80.0/focus/Phaser.Input.InputPlugin-isActive) (i)
9. [keyboard input active](https://newdocs.phaser.io/docs/3.80.0/focus/Phaser.Input.Keyboard.KeyboardPlugin-isActive) (k)See the [demo](https://codepen.io/samme/pen/VBbJZM) or [Cavern Quest](https://samme.itch.io/cavern-quest).
Browser / UMD
-------------```html
```
Use the global `PhaserSceneWatcherPlugin`.
```javascript
/* 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:
```javascript
import SceneWatcherPlugin from 'phaser-plugin-scene-watcher';new Phaser.Game({
plugins: {
global: [
{ key: 'SceneWatcher', plugin: SceneWatcherPlugin, start: true }
]
},
});
```Quick load
----------```javascript
function preload () {
this.load.plugin('PhaserSceneWatcherPlugin', 'https://cdn.jsdelivr.net/npm/[email protected]/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:
```javascript
new Phaser.Game({
callbacks: {
postBoot: function (game) {
// Use the `key` you added the plugin with.
game.plugins.get('SceneWatcher').watchAll();
}
}
});
```From a scene:
```javascript
function init () {
// Use the `key` you added the plugin with.
this.plugins.get('SceneWatcher').watchAll();
}
```