Skip to content

Commit e050c39

Browse files
committed
Gamedevs do it in the render method.
1 parent 7a12cff commit e050c39

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/utils/Debug.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@
66

77
/**
88
* A collection of methods for displaying debug information about game objects.
9+
*
10+
* If your game is running in Canvas mode, then you should invoke all of the Debug methods from
11+
* your games `render` function. This is because they are drawn directly onto the game canvas
12+
* itself, so if you call any debug methods outside of `render` they are likely to be overwritten
13+
* by the game itself.
14+
*
915
* If your game is running in WebGL then Debug will create a Sprite that is placed at the top of the Stage display list and bind a canvas texture
1016
* to it, which must be uploaded every frame. Be advised: this is very expensive, especially in browsers like Firefox. So please only enable Debug
1117
* in WebGL mode if you really need it (or your desktop can cope with it well) and disable it for production!
12-
* If your game is using a Canvas renderer then the debug information is literally drawn on the top of the active game canvas and no Sprite is used.
1318
*
1419
* @class Phaser.Utils.Debug
1520
* @constructor

0 commit comments

Comments
 (0)