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-body-colors

Colors Arcade Physics bodies by collision state
https://github.com/samme/phaser-plugin-debug-body-colors

phaser phaser-plugin phaser3 phaser3-plugin

Last synced: 2 months ago
JSON representation

Colors Arcade Physics bodies by collision state

Awesome Lists containing this project

README

        

![](https://samme.github.io/phaser-plugin-debug-body-colors/preview.png)

Phaser 3 Debug Body Colors Plugin
=================================

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

or

```js
function preload () {
this.load.scenePlugin('PhaserDebugBodyColorsPlugin', 'https://cdn.jsdelivr.net/npm/[email protected]');
}
```

Colors
------

- [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
--------

- [collide](https://codepen.io/samme/pen/aPdGKO)
- [overlap](https://codepen.io/samme/pen/RdYKqO)
- [First Phaser 2 game](https://codepen.io/samme/pen/LqGdON)
- [sprite pool](https://codepen.io/samme/pen/RwWmXrx)

[0]: https://photonstorm.github.io/phaser3-docs/Phaser.Physics.Arcade.Body.html#enable
[1]: https://photonstorm.github.io/phaser3-docs/Phaser.Physics.Arcade.Body.html#blocked
[2]: https://photonstorm.github.io/phaser3-docs/Phaser.Physics.Arcade.Body.html#touching
[3]: https://photonstorm.github.io/phaser3-docs/Phaser.Physics.Arcade.Body.html#embedded