API Docs for: 1.13.1
Show:

game.DebugDraw Class

Extends game.Class
Defined in: engine/debug.js:114
Module: debug

DebugDraw will draw all interactive sprite hit areas and physic shapes. Automatically enabled, if URL contains ?debugdraw.

Methods

addBody

(
  • body
)

Defined in engine/debug.js:174

Add physic body to DebugDraw.

Parameters:

addSprite

(
  • sprite
)

Defined in engine/debug.js:145

Add interactive sprite to DebugDraw.

Parameters:

drawBodySprite

(
  • sprite
  • body
)

Defined in engine/debug.js:190

Draw debug sprite for physics body.

Parameters:

extend

(
  • prop
)
game.Class

Inherited from game.Class: engine/core.js:757

Extend class.

Parameters:

  • prop Object

Returns:

init

(
  • arguments
)

Inherited from game.Class: engine/core.js:811

This method is called, when you create new instance of the class.

Parameters:

  • arguments Array

inject

(
  • prop
)

Inherited from game.Class: engine/core.js:825

Inject class.

Parameters:

  • prop Object

reset

()

Defined in engine/debug.js:129

Remove all sprites from DebugDraw.

staticInit

(
  • arguments
)

Inherited from game.Class: engine/core.js:795

This method is called before init.

Parameters:

  • arguments Array

update

()

Defined in engine/debug.js:243

Update DebugDraw sprites.

Attributes

bodyAlpha

Number

Defined in engine/debug.js:290

Alpha of DebugDraw bodies.

Default: 0.5

bodyColor

Number

Defined in engine/debug.js:278

Color of DebugDraw bodies.

Default: 0x0000ff

bodyLineColor

Number

Defined in engine/debug.js:284

Stroke color of DebugDraw bodies.

Default: 0xff0000

enabled

Boolean

Defined in engine/debug.js:255

Enable DebugDraw.

spriteAlpha

Number

Defined in engine/debug.js:272

Alpha of DebugDraw sprites.

Default: 0.5

spriteColor

Number

Defined in engine/debug.js:260

Color of DebugDraw sprites.

Default: 0xff0000

spriteLineColor

Number

Defined in engine/debug.js:266

Stroke color of DebugDraw sprites.

Default: 0x0000ff