Interface

Debug

:

An interface for debugging the game.

group Debug

paused

: boolean

Pause the whole game.

inspect

: boolean

Draw bounding boxes of all objects with area() component, hover to inspect their states.

timeScale

: number

Global time scale.

showLog

: boolean

Show the debug log or not.

fps

(): number

Current frames per second, that the game is running using (may be limited by the maxFPS or maxTimeStep options)

rawFPS

(): number

Raw frames per second from the browser unaffected by the maxFPS or maxTimeStep options.

numFrames

(): number

Total number of frames elapsed.

since v3000.0

drawCalls

(): number

Number of draw calls made last frame.

stepFrame

(): void

Step to the next frame. Useful with pausing.

clearLog

(): void

Clear the debug log.

logMessage

(message: DebugMessage[], wrapStyle?: DebugLogStyle): void

Log 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[]): void

Log 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[]): void

Log 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[]): void

Log 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 | null

The recording handle if currently in recording mode.

since v2000.1

numObjects

(): number

Get total number of objects.

since v3001.0

kaplay logo

Components

Miscellaneous