Phaser API Documentation

renderGrid(grid, graphics, lineColor, lineOpacity)


Renders the Engine Broadphase Controller Grid to the given Graphics instance.

The debug renderer calls this method if the showBroadphase config value is set.

This method is used internally by the Matter Debug Renderer, but is also exposed publically should you wish to render the Grid to your own Graphics instance.


name type description
grid MatterJS.Grid

The Matter Grid to be rendered.

graphics Phaser.GameObjects.Graphics

The Graphics object to render to.

lineColor number

The line color.

lineOpacity number

The line opacity, between 0 and 1.


This Matter World instance for method chaining.

Since: 3.22.0