Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/samme/phaser-plugin-debug-game-scale

Shows Phaser 3 Scale Manager state
https://github.com/samme/phaser-plugin-debug-game-scale

phaser phaser-plugin phaser3 phaser3-plugin scale-manager

Last synced: 7 days ago
JSON representation

Shows Phaser 3 Scale Manager state

Awesome Lists containing this project

README

        

![](https://repository-images.githubusercontent.com/314664684/cf308080-d4ba-11eb-8edd-6786eb2fc0d2)

Phaser 3 Debug Game Scale Plugin
================================

For your game scaling woes. It shows the [Scale Manager](https://newdocs.phaser.io/docs/3.80.1/Phaser.Scale.ScaleManager) state and logs [events](https://newdocs.phaser.io/docs/3.80.1/Phaser.Scale.Events). See [demos](https://codepen.io/collection/aMWjwK).

Browser / UMD
-------------

```js
/* global PhaserDebugGameScalePlugin */

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

Module
------

```js
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.

```js
// In preload():

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

```js
// In console:

game.scene.getScenes(true)[0].sys.load.plugin('PhaserDebugGameScalePlugin', 'https://cdn.jsdelivr.net/npm/[email protected]', true).start()
```