melonJS
    Preparing search index...

    Class DebugPanelPlugin

    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 draws operation
    • 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

    Hierarchy

    • BasePlugin
      • DebugPanelPlugin
    Index
    • Parameters

      • OptionaldebugToggle: number = input.KEY.S

        a default key to toggle the debug panel visibility state

      • app: undefined = undefined

      Returns DebugPanelPlugin

      input.KEY for default key options

    _drawSamples: Float32Array<ArrayBuffer>
    _onAfterDraw: (time: any) => void
    _onAfterUpdate: () => void
    _onBeforeDraw: (time: any) => void
    _onKeyDown: (_action: any, keyCode: any) => void
    _onResize: () => void
    _timeSampleCount: number
    _timeSampleIndex: number
    _updateSamples: Float32Array<ArrayBuffer>
    app: Application

    a reference to the app/game that registered this plugin

    counters: Counters
    debugToggle: number
    drawHistory: Float32Array<ArrayBuffer>
    frameDrawStartTime: number
    frameDrawTime: number
    frameUpdateTime: number
    graphCanvas: HTMLCanvasElement | undefined
    historyIndex: number
    memCanvas: HTMLCanvasElement | undefined
    memHistory: Float32Array<ArrayBuffer>
    options: {
        hitbox: string | boolean;
        quadtree: string | boolean;
        velocity: string | boolean;
    }
    panel: HTMLDivElement | null
    panelWrap: HTMLDivElement | null
    stats: {}
    updateHistory: Float32Array<ArrayBuffer>
    version: string
    visible: boolean