@melonjs/debug-plugin 14.6.3 → 14.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @classdesc
|
|
3
|
+
* a simple debug panel plugin <br>
|
|
4
|
+
* <img src="images/debugPanel.png"/> <br>
|
|
5
|
+
* <b>usage : </b><br>
|
|
6
|
+
* • upon loading the debug panel, it will be automatically registered under me.plugins.debugPanel <br>
|
|
7
|
+
* • you can then press the default "s" key to show or hide the panel, or use me.plugins.debugPanel.show() and me.plugins.debugPanel.show(), or add #debug as a parameter to your URL e.g. http://myURL/index.html#debug <br>
|
|
8
|
+
* • default key can be configured using the following parameters in the url : e.g. http://myURL/index.html#debugToggleKey=d <br>
|
|
9
|
+
* <b>the debug panel provides the following information : </b><br>
|
|
10
|
+
* • amount of total objects currently active in the current stage <br>
|
|
11
|
+
* • amount of draws operation <br>
|
|
12
|
+
* • amount of body shape (for collision) <br>
|
|
13
|
+
* • amount of bounding box <br>
|
|
14
|
+
* • amount of sprites objects <br>
|
|
15
|
+
* • amount of objects currently inactive in the the object pool <br>
|
|
16
|
+
* • memory usage (Heap Memory information is only available under Chrome) <br>
|
|
17
|
+
* • frame update time (in ms) <br>
|
|
18
|
+
* • frame draw time (in ms) <br>
|
|
19
|
+
* • current fps rate vs target fps <br>
|
|
20
|
+
* additionally, using the checkbox in the panel it is also possible to display : <br>
|
|
21
|
+
* • the hitbox or bounding box for all objects <br>
|
|
22
|
+
* • current velocity vector <br>
|
|
23
|
+
* • quadtree spatial visualization <br>
|
|
24
|
+
* @augments plugin.BasePlugin
|
|
25
|
+
*/
|
|
26
|
+
export class DebugPanelPlugin extends plugin.BasePlugin {
|
|
27
|
+
constructor(debugToggle: any);
|
|
28
|
+
panel: DebugPanel;
|
|
29
|
+
/**
|
|
30
|
+
* show the debug panel
|
|
31
|
+
*/
|
|
32
|
+
show(): void;
|
|
33
|
+
/**
|
|
34
|
+
* hide the debug panel
|
|
35
|
+
*/
|
|
36
|
+
hide(): void;
|
|
37
|
+
/**
|
|
38
|
+
* toggle the debug panel visibility state
|
|
39
|
+
*/
|
|
40
|
+
toggle(): void;
|
|
41
|
+
}
|
|
42
|
+
import { plugin } from 'melonjs';
|
|
43
|
+
declare class DebugPanel extends Renderable {
|
|
44
|
+
constructor(debugToggle?: number);
|
|
45
|
+
checkbox: {};
|
|
46
|
+
counters: Counters;
|
|
47
|
+
visible: boolean;
|
|
48
|
+
frameUpdateTime: number;
|
|
49
|
+
frameDrawTime: number;
|
|
50
|
+
version: string;
|
|
51
|
+
canvas: HTMLCanvasElement | OffscreenCanvas;
|
|
52
|
+
font_size: number;
|
|
53
|
+
mod: number;
|
|
54
|
+
font: BitmapText;
|
|
55
|
+
debugToggle: number;
|
|
56
|
+
keyHandler: import("eventemitter3").EventEmitter<string | symbol, any>;
|
|
57
|
+
help_str: string;
|
|
58
|
+
help_str_len: number;
|
|
59
|
+
fps_str_len: number;
|
|
60
|
+
memoryPositionX: number;
|
|
61
|
+
frameUpdateStartTime: number;
|
|
62
|
+
frameDrawStartTime: number;
|
|
63
|
+
/**
|
|
64
|
+
* patch system fn to draw debug information
|
|
65
|
+
*/
|
|
66
|
+
patchSystemFn(): void;
|
|
67
|
+
/**
|
|
68
|
+
* show the debug panel
|
|
69
|
+
*/
|
|
70
|
+
show(): void;
|
|
71
|
+
/**
|
|
72
|
+
* hide the debug panel
|
|
73
|
+
*/
|
|
74
|
+
hide(): void;
|
|
75
|
+
update(): boolean;
|
|
76
|
+
onClick(e: any): void;
|
|
77
|
+
drawQuadTreeNode(renderer: any, node: any): void;
|
|
78
|
+
drawQuadTree(renderer: any): void;
|
|
79
|
+
/** @private */
|
|
80
|
+
private drawMemoryGraph;
|
|
81
|
+
draw(renderer: any): void;
|
|
82
|
+
}
|
|
83
|
+
import { Renderable } from 'melonjs';
|
|
84
|
+
declare class Counters {
|
|
85
|
+
stats: any[];
|
|
86
|
+
reset(): void;
|
|
87
|
+
inc(stat: any, value: any): void;
|
|
88
|
+
get(stat: any): any;
|
|
89
|
+
}
|
|
90
|
+
import { BitmapText } from 'melonjs';
|
|
91
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS debug plugin - v14.6.
|
|
2
|
+
* melonJS debug plugin - v14.6.4
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* @melonjs/debug-plugin is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -71,7 +71,7 @@ class DebugPanel extends Renderable {
|
|
|
71
71
|
this.name = "debugPanel";
|
|
72
72
|
|
|
73
73
|
// the debug panel version
|
|
74
|
-
this.version = "14.6.
|
|
74
|
+
this.version = "14.6.4";
|
|
75
75
|
|
|
76
76
|
// persistent
|
|
77
77
|
this.isPersistent = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@melonjs/debug-plugin",
|
|
3
|
-
"version": "14.6.
|
|
3
|
+
"version": "14.6.4",
|
|
4
4
|
"description": "melonJS debug plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"types": "dist/@melonjs/debug-plugin.d.ts",
|
|
42
42
|
"sideEffects": false,
|
|
43
43
|
"files": [
|
|
44
|
-
"dist
|
|
44
|
+
"dist/",
|
|
45
45
|
"src/",
|
|
46
46
|
"package.json",
|
|
47
47
|
"README.md",
|