LittleJS Debug System
- Debug overlay with mouse pick
- Debug primitive rendering
- Save screenshots to disk
- Debug overlay with mouse pick
- Debug primitive rendering
- Save screenshots to disk
- Source:
Members
# (static, constant) ASSERT
Asserts if the experssion is false, does not do anything in release builds
- Source:
# (static, constant) debug
True if debug is enabled
- Default Value:
- 1
- Source:
# (static, constant) debugPointSize
Size to render debug points by default
- Default Value:
- 0.5
- Source:
# (static, constant) enableAsserts
True if asserts are enaled
- Default Value:
- 1
- Source:
# (static) godMode
True if god mode is enabled, handle this however you want
- Source:
# (static) showWatermark
True if watermark with FPS should be down
- Default Value:
- 1
- Source:
Methods
# (static) debugAABB(posA, sizeA, posB, sizeB, coloropt)
Draw a debug axis aligned bounding box in world space
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
posA |
Vector2 | |||
sizeA |
Vector2 | |||
posB |
Vector2 | |||
sizeB |
Vector2 | |||
color |
String |
<optional> |
'#fff' |
- Source:
# (static) debugCircle(pos, radiusopt, coloropt, timeopt, fillopt)
Draw a debug circle in world space
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pos |
Vector2 | |||
radius |
Number |
<optional> |
0 | |
color |
String |
<optional> |
'#fff' | |
time |
Number |
<optional> |
0 | |
fill |
Boolean |
<optional> |
0 |
- Source:
# (static) debugClear()
Clear all debug primitives in the list
- Source:
# (static) debugLine(posA, posB, coloropt, thicknessopt, timeopt)
Draw a debug line in world space
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
posA |
Vector2 | |||
posB |
Vector2 | |||
color |
String |
<optional> |
'#fff' | |
thickness |
Number |
<optional> |
.1 | |
time |
Number |
<optional> |
0 |
- Source:
# (static) debugPoint(pos, coloropt, timeopt, angleopt)
Draw a debug point in world space
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pos |
Vector2 | |||
color |
String |
<optional> |
'#fff' | |
time |
Number |
<optional> |
0 | |
angle |
Number |
<optional> |
0 |
- Source:
# (static) debugRect(pos, sizeopt, coloropt, timeopt, angleopt, fillopt)
Draw a debug rectangle in world space
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pos |
Vector2 | |||
size |
Vector2 |
<optional> |
new Vector2() | |
color |
String |
<optional> |
'#fff' | |
time |
Number |
<optional> |
0 | |
angle |
Number |
<optional> |
0 | |
fill |
Boolean |
<optional> |
0 |
- Source:
# (static) debugSaveCanvas(canvas, filenameopt)
Save a canvas to disk
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
canvas |
HTMLCanvasElement | ||
filename |
String |
<optional> |
- Source:
# (static) debugText(text, pos, sizeopt, coloropt, timeopt, angleopt, fontopt)
Draw a debug axis aligned bounding box in world space
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
text |
String | |||
pos |
Vector2 | |||
size |
Number |
<optional> |
1 | |
color |
String |
<optional> |
'#fff' | |
time |
Number |
<optional> |
0 | |
angle |
Number |
<optional> |
0 | |
font |
String |
<optional> |
'monospace' |
- Source: