Skip to content

samme/phaser-plugin-sound-watcher

Repository files navigation

Phaser Sound Watcher Plugin

Shows sounds in the Sound Manager.

Symbols

Symbol Description
# locked
▁▂▃▄▅▆▇█ volume
m mute
> playing
: paused
. not playing or paused
<<+>> pan
key:marker key, marker name
[0.0 / 1.0] seek, duration
@(x, y) position
a has audio tag
- has no audio tag

Module

import SoundWatcherPlugin from 'phaser-plugin-sound-watcher'

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

UMD

<!-- after phaser.js -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
/* global Phaser, SoundWatcherPlugin */

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

Quick load

this.load.plugin('SoundWatcherPlugin', 'https://cdn.jsdelivr.net/npm/[email protected]')

Load from console

Given a global game variable:

game.scene.systemScene.load.plugin('SoundWatcherPlugin', 'https://cdn.jsdelivr.net/npm/[email protected]').start()