/** * @classdesc * 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)
* • frame draw time (in ms)
* • 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
* @augments plugin.BasePlugin */ export class DebugPanelPlugin extends plugin.BasePlugin { /** * @param {number} [debugToggle=input.KEY.S] - a default key to toggle the debug panel visibility state * @see input.KEY for default key options */ constructor(debugToggle?: number); debugToggle: number; counters: Counters; visible: boolean; options: { hitbox: string | boolean; velocity: string | boolean; quadtree: string | boolean; }; updateHistory: Float32Array; drawHistory: Float32Array; memHistory: Float32Array; historyIndex: number; panel: HTMLDivElement | null; panelWrap: HTMLDivElement | null; stats: {}; frameUpdateStartTime: number; frameDrawStartTime: number; frameUpdateTime: number; frameDrawTime: number; _onResize: () => void; _onBeforeUpdate: (time: any) => void; _onAfterUpdate: (time: any) => void; _onBeforeDraw: (time: any) => void; _onAfterDraw: (time: any) => void; _onKeyDown: (_action: any, keyCode: any) => void; /** @private */ private _buildPanel; graphCanvas: HTMLCanvasElement | undefined; memCanvas: HTMLCanvasElement | undefined; /** @private */ private _syncPosition; /** @private */ private _updatePanel; /** * show the debug panel */ show(): void; /** * hide the debug panel */ hide(): void; /** * toggle the debug panel visibility state */ toggle(): void; /** @private */ private _drawQuadTree; /** @private */ private _drawQuadTreeNode; /** * destroy the debug plugin */ destroy(): void; } import { plugin } from "melonjs"; import Counters from "./counters.js"; //# sourceMappingURL=index.d.ts.map