Phaser API Documentation

  Version: 
debugCallback: function

Description:

You can optionally choose to render the vertices of this Mesh to a Graphics instance.

Achieve this by setting the debugCallback and the debugGraphic properties.

You can do this in a single call via the Mesh.setDebug method, which will use the built-in debug function. You can also set it to your own callback. The callback will be invoked once per render and sent the following parameters:

debugCallback(src, meshLength, verts)

src is the Mesh instance being debugged. meshLength is the number of mesh vertices in total. verts is an array of the translated vertex coordinates.

To disable rendering, set this property back to null.

Please note that high vertex count Meshes will struggle to debug properly.

Type:
function
Since: 3.50.0