GeezerVison is showing melonjs.github.io — DebugPanelPlugin | melonJS
a simple debug panel plugin
usage :
• upon loading the debug panel, it will be automatically registered under me.plugins.debugPanel
• you can then press the default "s" key to show or hide the panel, or use me.plugins.debugPanel.show() and me.plugins.debugPanel.hide(), or add #debug as a parameter to your URL e.g. http://myURL/index.html#debug
• default key can be configured using the following parameters in the url : e.g. http://myURL/index.html#debugToggleKey=d
the debug panel provides the following information :
• amount of total objects currently active in the current stage
• amount of the world's direct children drawn this frame
• amount of body shape (for collision)
• amount of bounding box
• amount of sprites objects
• amount of objects currently inactive in the the object pool
• memory usage (Heap Memory information is only available under Chrome)
• frame update time (in ms, averaged over the last 30 frames)
• frame draw time (in ms, averaged over the last 30 frames)
• current fps rate vs target fps
additionally, using the checkbox in the panel it is also possible to display :
• the hitbox or bounding box for all objects
• current velocity vector
• quadtree spatial visualization
Constructors
constructor
-
new DebugPanelPlugin(debugToggle?: number, app?: undefined): DebugPanelPlugin
Parameters
OptionaldebugToggle: number = input.KEY.S
a default key to toggle the debug panel visibility state
- app: undefined = undefined
Returns DebugPanelPlugin
See
input.KEY for default key options
Properties
_drawSamples
_drawSamples: Float32Array<ArrayBuffer>
_onAfterDraw
_onAfterDraw: (time: any) => void
_onAfterUpdate
_onAfterUpdate: () => void
_onBeforeDraw
_onBeforeDraw: (time: any) => void
_onKeyDown
_onKeyDown: (_action: any, keyCode: any) => void
_onResize
_onResize: () => void
_timeSampleCount
_timeSampleCount: number
_timeSampleIndex
_timeSampleIndex: number
_updateSamples
_updateSamples: Float32Array<ArrayBuffer>
app
app: Application
a reference to the app/game that registered this plugin
counters
counters: Counters
debugToggle
debugToggle: number
drawHistory
drawHistory: Float32Array<ArrayBuffer>
frameDrawStartTime
frameDrawStartTime: number
frameDrawTime
frameDrawTime: number
frameUpdateTime
frameUpdateTime: number
graphCanvas
graphCanvas: HTMLCanvasElement | undefined
historyIndex
historyIndex: number
memCanvas
memCanvas: HTMLCanvasElement | undefined
memHistory
memHistory: Float32Array<ArrayBuffer>
options
options: {
hitbox: string | boolean;
quadtree: string | boolean;
velocity: string | boolean;
}
panel
panel: HTMLDivElement | null
panelWrap
panelWrap: HTMLDivElement | null
updateHistory
updateHistory: Float32Array<ArrayBuffer>
Methods
toggle
-
toggle the debug panel visibility state
Returns void
Settings
Member Visibility
- Protected
- Inherited
- External
Theme
On This Page
Constructors
Properties
Methods