@melonjs/debug-plugin 14.6.2 → 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
+ * &bull; upon loading the debug panel, it will be automatically registered under me.plugins.debugPanel <br>
7
+ * &bull; 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
+ * &bull; 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
+ * &bull; amount of total objects currently active in the current stage <br>
11
+ * &bull; amount of draws operation <br>
12
+ * &bull; amount of body shape (for collision) <br>
13
+ * &bull; amount of bounding box <br>
14
+ * &bull; amount of sprites objects <br>
15
+ * &bull; amount of objects currently inactive in the the object pool <br>
16
+ * &bull; memory usage (Heap Memory information is only available under Chrome) <br>
17
+ * &bull; frame update time (in ms) <br>
18
+ * &bull; frame draw time (in ms) <br>
19
+ * &bull; current fps rate vs target fps <br>
20
+ * additionally, using the checkbox in the panel it is also possible to display : <br>
21
+ * &bull; the hitbox or bounding box for all objects <br>
22
+ * &bull; current velocity vector <br>
23
+ * &bull; 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
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.2";
74
+ this.version = "14.6.4";
75
75
 
76
76
  // persistent
77
77
  this.isPersistent = true;
@@ -588,16 +588,16 @@ class DebugPanel extends Renderable {
588
588
  * &bull; the hitbox or bounding box for all objects <br>
589
589
  * &bull; current velocity vector <br>
590
590
  * &bull; quadtree spatial visualization <br>
591
- * @augments plugin.Base
591
+ * @augments plugin.BasePlugin
592
592
  */
593
- class DebugPanelPlugin extends plugin.Base {
593
+ class DebugPanelPlugin extends plugin.BasePlugin {
594
594
 
595
595
  constructor(debugToggle) {
596
596
  // call the super constructor
597
597
  super();
598
598
 
599
599
  // minimum melonJS version expected
600
- this.version = "15.1.5";
600
+ this.version = "15.2.0";
601
601
 
602
602
  this.panel = new DebugPanel(debugToggle);
603
603
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@melonjs/debug-plugin",
3
- "version": "14.6.2",
3
+ "version": "14.6.4",
4
4
  "description": "melonJS debug plugin",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -41,14 +41,14 @@
41
41
  "types": "dist/@melonjs/debug-plugin.d.ts",
42
42
  "sideEffects": false,
43
43
  "files": [
44
- "dist/@melonjs/debug-plugin.js",
44
+ "dist/",
45
45
  "src/",
46
46
  "package.json",
47
47
  "README.md",
48
48
  "LICENSE"
49
49
  ],
50
50
  "peerDependencies": {
51
- "melonjs": "^15.1.6"
51
+ "melonjs": "^15.2.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@babel/eslint-parser": "^7.21.8",
@@ -59,7 +59,7 @@
59
59
  "@rollup/plugin-replace": "^5.0.2",
60
60
  "del-cli": "^5.0.0",
61
61
  "eslint": "^8.40.0",
62
- "eslint-plugin-jsdoc": "^44.2.2",
62
+ "eslint-plugin-jsdoc": "^44.2.3",
63
63
  "rollup": "^3.21.6",
64
64
  "rollup-plugin-bundle-size": "^1.0.3",
65
65
  "rollup-plugin-string": "^3.0.0",
package/src/index.js CHANGED
@@ -24,16 +24,16 @@ import { DebugPanel } from "./debugPanel";
24
24
  * &bull; the hitbox or bounding box for all objects <br>
25
25
  * &bull; current velocity vector <br>
26
26
  * &bull; quadtree spatial visualization <br>
27
- * @augments plugin.Base
27
+ * @augments plugin.BasePlugin
28
28
  */
29
- export class DebugPanelPlugin extends plugin.Base {
29
+ export class DebugPanelPlugin extends plugin.BasePlugin {
30
30
 
31
31
  constructor(debugToggle) {
32
32
  // call the super constructor
33
33
  super();
34
34
 
35
35
  // minimum melonJS version expected
36
- this.version = "15.1.5";
36
+ this.version = "15.2.0";
37
37
 
38
38
  this.panel = new DebugPanel(debugToggle);
39
39