@melonjs/debug-plugin 14.4.2

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (C) 2011 - 2023 Olivier Biot (AltByte Pte Ltd)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # melonJS Debug Plugin
2
+ ![melonJS Logo](https://github.com/melonjs/melonJS/raw/master/media/Banner/Banner%20-%20Billboard%20-%20Original%20Logo%20-%20horizontal.png)
3
+
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/melonjs/es6-boilerplate/blob/master/LICENSE)
5
+
6
+ Installation
7
+ -------------------------------------------------------------------------------
8
+ `$ [sudo] npm install @melonjs/debug-plugin --save-dev`
9
+
10
+ Then import and instantiante the debug plugin in your project. For example:
11
+ ```JavaScript
12
+ import { utils, plugin } from 'melonjs';
13
+ // initialize the debug plugin in development mode.
14
+ if (typeof process !== "undefined" && process.env.NODE_ENV === 'development') {
15
+ import("melonjs-debug-plugin.js").then((debugPlugin) => {
16
+ // automatically register the debug panel
17
+ utils.function.defer(plugin.register, this, debugPlugin.DebugPanelPlugin, "debugPanel");
18
+ });
19
+ }
20
+ ```
21
+
22
+ Usage
23
+ -------------------------------------------------------------------------------
24
+
25
+ The Debug Panel is hidden by default and can be displayed using the `S` key, it will then provide the below information :
26
+ ![debug-panel](https://user-images.githubusercontent.com/4033090/138006717-cf3165a4-a52d-4855-a7c7-16b2a09ed124.png)
27
+
28
+ * Amount of objects currently active in the current scene
29
+ * Amount of draws operation
30
+ * Amount of body shape (requires to enable the hitbox checkbox)
31
+ * Amount of bounding box
32
+ * Amount of sprites objects
33
+ * Amount of objects currently inactive in the the object pool
34
+ * Heap/memory usage
35
+ * Frame update time (in ms)
36
+ * Frame draw time (in ms)
37
+ * Current fps rate vs target fps
38
+
39
+ > Note: Heap information requires starting Chrome [with](http://www.chromium.org/developers/how-tos/run-chromium-with-flags) `--enable-precise-memory-info`
40
+
41
+ Additionally, using the checkbox in the panel it is also possible to draw :
42
+ * Shape and Bounding box for all objects
43
+ * Current velocity vector
44
+ * Quadtree spatial visualization
45
+
46
+ Questions, need help ?
47
+ -------------------------------------------------------------------------------
48
+ If you need technical support, you can contact us through the following channels :
49
+ * Forums: with melonJS 2 we moved to a new discourse [forum](https://melonjs.discourse.group), but we can still also find the previous one [here](http://www.html5gamedevs.com/forum/32-melonjs/)
50
+ * Chat: come and chat with us on [discord](https://discord.gg/aur7JMk), or [gitter](https://gitter.im/melonjs/public)
51
+ * we tried to keep our [wikipage](https://github.com/melonjs/melonJS/wiki) up-to-date with useful links, tutorials, and anything related melonJS.