@stanko/kaplay-inspector 0.0.1 → 0.0.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/README.md +12 -2
- package/package.json +1 -1
- package/public/screenshot.png +0 -0
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A dev tool for [Kaplay](https://kaplayjs.com/) which allows you to explore and inspect the game object tree.
|
|
4
4
|
|
|
5
|
+

|
|
6
|
+
|
|
5
7
|
## Features
|
|
6
8
|
|
|
7
9
|
- Navigate the game object tree
|
|
@@ -15,7 +17,15 @@ A dev tool for [Kaplay](https://kaplayjs.com/) which allows you to explore and i
|
|
|
15
17
|
|
|
16
18
|
## Usage
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
Install it:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
npm install @stanko/kaplay-inspector
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
This is a dev tool, so I strongly recommend you import it only in development mode. This will prevent from the inspector showing up when you ship your game to players.
|
|
27
|
+
|
|
28
|
+
If you are using vite, it exposes the dev flag in `import.meta.env.DEV`. For other bundlers check their documentation.
|
|
19
29
|
|
|
20
30
|
You'll need to import the CSS and `init` method, here is an example using vite:
|
|
21
31
|
|
|
@@ -32,7 +42,7 @@ if (
|
|
|
32
42
|
// This gives you an easy way to enable or disable it
|
|
33
43
|
new URLSearchParams(window.location.search).get("inspector") !== null
|
|
34
44
|
) {
|
|
35
|
-
import("@stanko/kaplay-inspector/styles.css");
|
|
45
|
+
import("@stanko/kaplay-inspector/dist/styles.css");
|
|
36
46
|
import("@stanko/kaplay-inspector").then(({ default: init }) => {
|
|
37
47
|
// Pass the "k" instance to the inspector
|
|
38
48
|
init(k);
|
package/package.json
CHANGED
|
Binary file
|