Skip to content

samme/phaser-plugin-debug-game-scale

Repository files navigation

Phaser 3 Debug Game Scale Plugin

For your game scaling woes. It shows the Scale Manager state and logs events. See demos.

Browser / UMD

<script src="https://cdn.jsdelivr.net/npm/phaser-plugin-debug-game-scale@4.1.0"></script>
/* global PhaserDebugGameScalePlugin */

new Phaser.Game({
    type: Phaser.CANVAS,
    plugins: {
        global: [
            { key: 'DebugGameScalePlugin', plugin: PhaserDebugGameScalePlugin, start: true }
        ]
    }
}

Module

import DebugGameScalePlugin from 'phaser-plugin-debug-game-scale'

new Phaser.Game({
    type: Phaser.CANVAS,
    plugins: {
        global: [
            { key: 'DebugGameScalePlugin', plugin: DebugGameScalePlugin, start: true }
        ]
    }
}

Quick load

You must use the Phaser.CANVAS renderer.

// In preload():

this.load.plugin('PhaserDebugGameScalePlugin', 'https://cdn.jsdelivr.net/npm/phaser-plugin-debug-game-scale@4.1.0', true)
// In console:

game.scene.getScenes(true)[0].sys.load.plugin('PhaserDebugGameScalePlugin', 'https://cdn.jsdelivr.net/npm/phaser-plugin-debug-game-scale@4.1.0', true).start()