Phaser API Documentation

renderDebug(graphics, [styleConfig], [layer])


Draws a debug representation of the layer to the given Graphics object. This is helpful when you want to get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation wherever you want on the screen.

If no layer is specified, the maps current layer is used.

Note: This method currently only works with orthogonal tilemap layers.


name type arguments description
graphics Phaser.GameObjects.Graphics

The target Graphics object to draw upon.

styleConfig Phaser.Types.Tilemaps.StyleConfig <optional>

An object specifying the colors to use for the debug drawing.

layer string | number | Phaser.Tilemaps.TilemapLayer <optional>

The tile layer to use. If not given the current layer is used.


Return this Tilemap object, or null if the layer given was invalid.

Since: 3.0.0
Source: src/tilemaps/Tilemap.js (Line 1927)