https://github.com/samme/phaser-plugin-debug-body-colors
Colors Arcade Physics bodies by collision state
https://github.com/samme/phaser-plugin-debug-body-colors
phaser phaser-plugin physics
Last synced: about 2 months ago
JSON representation
Colors Arcade Physics bodies by collision state
- Host: GitHub
- URL: https://github.com/samme/phaser-plugin-debug-body-colors
- Owner: samme
- Created: 2018-06-18T17:07:33.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-01-22T07:47:05.000Z (4 months ago)
- Last Synced: 2025-04-11T20:05:16.513Z (about 2 months ago)
- Topics: phaser, phaser-plugin, physics
- Language: JavaScript
- Homepage: https://codepen.io/collection/yyBZBZ?grid_type=grid
- Size: 286 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README

Colors Arcade Physics bodies by collision state.
| State | Color |
|--------------------------------------------------|--------|
| [disabled][0] | gray |
| [blocked][1], not disabled | red |
| [touching][2], not disabled or blocked | yellow |
| [embedded][3], not disabled, blocked or touching | aqua |
| not disabled, blocked, touching, or embedded | violet |- [Examples](https://codepen.io/collection/yyBZBZ?grid_type=grid)
UMD
---```html
```
```javascript
/* global Phaser, PhaserDebugBodyColorsPlugin */new Phaser.Game({
plugins: {
scene: [
{ key: 'DebugBodyColorsPlugin', plugin: PhaserDebugBodyColorsPlugin, mapping: 'debugBodyColors' }
]
},
physics: {
arcade: { debug: true }
}
});
```Quick load
----------```js
function preload () {
this.load.scenePlugin('PhaserDebugBodyColorsPlugin', 'https://cdn.jsdelivr.net/npm/[email protected]');
}
```Module
------```javascript
import DebugBodyColorsPlugin from 'phaser-plugin-debug-body-colors';new Phaser.Game({
plugins: {
scene: [
{ key: 'DebugBodyColorsPlugin', plugin: DebugBodyColorsPlugin, mapping: 'debugBodyColors' }
]
},
physics: {
arcade: { debug: true }
}
});
```[0]: https://docs.phaser.io/api-documentation/class/physics-arcade-body#enable
[1]: https://docs.phaser.io/api-documentation/class/physics-arcade-body#blocked
[2]: https://docs.phaser.io/api-documentation/class/physics-arcade-body#touching
[3]: https://docs.phaser.io/api-documentation/class/physics-arcade-body#embedded