Debug
:An interface for debugging the game.
group Debug
paused
: booleanPause the whole game.
inspect
: booleanDraw bounding boxes of all objects with area() component, hover to inspect their states.
timeScale
: numberGlobal time scale.
showLog
: booleanShow the debug log or not.
fps
(): numberCurrent frames per second, that the game is running using
(may be limited by the maxFPS or maxTimeStep options)
rawFPS
(): numberRaw frames per second from the browser unaffected by
the maxFPS or maxTimeStep options.
numFrames
(): numberTotal number of frames elapsed.
since v3000.0
drawCalls
(): numberNumber of draw calls made last frame.
stepFrame
(): voidStep to the next frame. Useful with pausing.
clearLog
(): voidClear the debug log.
logMessage
(message: DebugMessage[], wrapStyle?: DebugLogStyle): voidLog a message to the on-screen debug log, with optional style wrapping.
param message- The messages to log
param wrapStyle- Style to wrap all messages
```
debug.logMessage(["oh", "hi"], "warn"); since v4000.0
log
(message: DebugMessage[]): voidLog a message with the info style (white) to the on-screen debug log.
param message- The message to log
```
debug.log("oh", "hi") warn
(message: DebugMessage[]): voidLog a message with the warn style (yellow) to the on-screen debug log.
param message- The message to log
```
debug.warn("oh", "humm") since v4000.0
error
(message: DebugMessage[]): voidLog a message with the error style (pink since kaboom) to the on-screen debug log.
param message- The message to log
```
debug.error("oh", "no") curRecording
: Recording | nullThe recording handle if currently in recording mode.
since v2000.1
numObjects
(): numberGet total number of objects.
since v3001.0