phaser-plugin-debug-body-colors

4.0.0 • Public • Published

Colors Arcade Physics bodies by collision state.

State Color
disabled gray
blocked, not disabled red
touching, not disabled or blocked yellow
embedded, not disabled, blocked or touching aqua
not disabled, blocked, touching, or embedded violet

UMD

<!-- after phaser.js -->
<script src="https://cdn.jsdelivr.net/npm/phaser-plugin-debug-body-colors@4.0.0"></script>
/* global Phaser, PhaserDebugBodyColorsPlugin */

new Phaser.Game({
  plugins: {
    scene: [
      { key: 'DebugBodyColorsPlugin', plugin: PhaserDebugBodyColorsPlugin, mapping: 'debugBodyColors' }
    ]
  },
  physics: {
    arcade: { debug: true }
  }
});

Quick load

function preload () {
  this.load.scenePlugin('PhaserDebugBodyColorsPlugin', 'https://cdn.jsdelivr.net/npm/phaser-plugin-debug-body-colors@4.0.0');
}

Module

import DebugBodyColorsPlugin from 'phaser-plugin-debug-body-colors';

new Phaser.Game({
  plugins: {
    scene: [
      { key: 'DebugBodyColorsPlugin', plugin: DebugBodyColorsPlugin, mapping: 'debugBodyColors' }
    ]
  },
  physics: {
    arcade: { debug: true }
  }
});

Package Sidebar

Install

npm i phaser-plugin-debug-body-colors

Weekly Downloads

6

Version

4.0.0

License

ISC

Unpacked Size

5.99 kB

Total Files

4

Last publish

Collaborators

  • samme