Phaser API Documentation

renderBodyVelocity(bodies, graphics, lineColor, lineOpacity, lineThickness)


Renders a velocity indicator for an array of Bodies, to the given Graphics instance.

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

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


name type description
bodies array

An array of bodies from the localWorld.

graphics Phaser.GameObjects.Graphics

The Graphics object to render to.

lineColor number

The line color.

lineOpacity number

The line opacity, between 0 and 1.

lineThickness number

The line thickness.

Since: 3.22.0