kaplay-ui 0.20.6 → 0.20.7

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.
Files changed (2) hide show
  1. package/README.md +21 -7
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -8,7 +8,7 @@ _A simple and customizable UI plugin library for building interfaces in https://
8
8
 
9
9
  Kaplay UI provides a game‑oriented **UI plugin** designed specifically for KAPLAY.
10
10
 
11
- It helps you build buttons, menus, controls, HUD elements, input fields, and more—without reinventing the wheel.
11
+ It helps you build Game Objects like buttons, menus, controls, HUD elements, input fields, and more—without reinventing the wheel.
12
12
 
13
13
  > ⚠️ **Note**
14
14
  > The currently published stable version (`0.20.1`) is being replaced by a complete redesign.
@@ -36,26 +36,40 @@ This gives you the latest `1.0.0‑alpha.*` builds.
36
36
 
37
37
  ## 🚀 Usage
38
38
 
39
- Kaplay UI exports a plugin for adding UI elements.
39
+ Kaplay UI exports a plugin for adding UI Game Objects.
40
40
 
41
41
  The plugin is exported from the package root:
42
42
 
43
43
  ```ts
44
+ import kaplay from "kaplay";
44
45
  import kaplayUI from "kaplay-ui";
46
+
47
+ const k = kaplay({
48
+ plugins: [kaplayUI],
49
+ });
50
+
45
51
  ```
46
52
 
47
53
  ---
48
54
 
49
- ## 🧩 Game Object (_**will evolve over time**_)
50
-
51
- ### **Switch**
55
+ ## 🧩 Game Objects (_**will evolve over time**_)
52
56
 
53
57
  ### **Text Button**
54
58
 
55
- Clickable text-based button:
59
+ Text-based button with centered text:
56
60
 
57
61
  ```ts
58
- const txtBtn = addTextButton("Play!", 200, 100);
62
+ // Button with default centered "Button" text, width of 200, height of 100
63
+ const txtBtn = addTextButton();
64
+
65
+ // Button with centered "Play!" text, default width of 200, height of 100
66
+ const txtBtn = addTextButton("Play!");
67
+
68
+ // Button with default centered "Play!" text, width of 250, default height of 100
69
+ const txtBtn = addTextButton("Play!", 250);
70
+
71
+ // Button with default centered "Play!" text, width of 250, height of 150
72
+ const txtBtn = addTextButton("Play!", 250, 150);
59
73
  ```
60
74
 
61
75
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaplay-ui",
3
- "version": "0.20.6",
3
+ "version": "0.20.7",
4
4
  "description": "UI components for KAPLAY",
5
5
  "main": "index.js",
6
6
  "repository": {