Debug

Module: engine.debug

Instance of Debug class is created at game.debug, when game.Debug.enabled is true.

Properties

_bodies Array

(No description yet)

_camera Camera

(No description yet)

_fakeTouches Array

(No description yet)

_fakeTouchId Number

(No description yet)

_fakeTouchTimer Number

(No description yet)

_frames Number

(No description yet)

fps Number

Current fps.

last Number

Time of last update.

panel HTMLDivElement

Debug panel.

sprites Number

Sprites count.

text String

Debug panel text.

Methods

_addPanel()

(No description yet)

_drawBodies()

(No description yet)

_drawBody(body)

(No description yet)

Parameters:

  • body Body
_drawCamera()

(No description yet)

_drawFakeTouch()

(No description yet)

_drawHitArea(container)

(No description yet)

Parameters:

  • container Container
_drawHitAreas()

(No description yet)

_drawSprite(container)

(No description yet)

Parameters:

  • container Container
_reset()

(No description yet)

_update()

(No description yet)

_updateFakeTouch()

(No description yet)

_updatePanel()

(No description yet)

addText(name, value)

Add text to debug panel.

Parameters:

  • name String
  • value Number|Boolean|String
updatePanel() Static

Function that is called every time the debug panel is updated.

Attributes

bodyAlpha Number (Default: 0.5)

Alpha of bodies.

bodyColor Number (Default: #00ff00)

Color of bodies.

bodyLineColor Number (Default: #ffff00)

Stroke color of bodies.

bodyLineWidth Number (Default: 1)

Body line width.

boundAlpha Number (Default: 0.5)

Alpha of bounds.

boundColor Number (Default: #ff0000)

Color of bounds.

boundLineWidth Number (Default: 1)

Bounds line width.

cameraAlpha Number (Default: 0.2)

Alpha of camera.

cameraColor String (Default: #ff00ff)

Color of camera.

enabled Boolean (Default: false)

Enable debugging (can also be enabled with ?debug on url).

fakeTouch Boolean (Default: false)

Enable fake touches.

fakeTouchAlpha Number (Default: 0.2)

Sprite alpha for fake touches.

fakeTouchColor String (Default: #ffff00)

Sprite color for fake touches.

fakeTouchInterval Number (Default: 100)

How often to create new fake touch (ms).

fakeTouchMaxLife Number (Default: 400)

Maximum lifetime of fake touch (ms).

fakeTouchMaxSpeed Number (Default: 50)

Maximum speed of fake touch movement.

fakeTouchMinLife Number (Default: 100)

Minimum lifetime of fake touch (ms).

fakeTouchMinSpeed Number (Default: 1)

Minimum speed of fake touch movement.

fakeTouchMoveInterval Number (Default: 50)

How often to move fake touch (ms).

fakeTouchMovePercent Number (Default: 50)

Percent of fake touches, that will move.

fakeTouchSize Number (Default: 20)

Sprite radius of fake touches.

hitAreaAlpha Number (Default: 0.5)

(No description yet)

hitAreaColor String (Default: #0000ff)

(No description yet)

panelAlpha Number (Default: 1.0)

Alpha of debug panel.

panelBackground String (Default: rgba(0, 0, 0, 0.7))

Background color of debug panel.

panelColor String (Default: #ff0000)

Text color of debug panel.

panelFontSize Number (Default: 14)

Debug panel font size.

panelPosition String (Default: bottom)

Vertical position of debug panel (top or bottom).

panelUpdate Number (Default: 500)

How often to update debug panel (ms).

showBodies Boolean (Default: false)

Draw physics bodies.

showCamera Boolean (Default: false)

Draw camera debug.

showHitAreas Boolean (Default: false)

Draw interactive container hit areas.

showInfo Boolean (Default: true)

Show version info on console.

showPanel Boolean (Default: true)

Show debug panel.

showSprites Boolean (Default: false)

Draw sprites.