kaplay-ui 0.9.3 → 0.9.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.
Files changed (2) hide show
  1. package/README.md +23 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -24,18 +24,37 @@ npm install kaplay-ui
24
24
 
25
25
  ## Usage
26
26
 
27
- Here’s a quick example of how to add a simple clickable and hoverable text button using Kaplay UI:
27
+ ### Buttons
28
+
29
+ ### Text Button
30
+
31
+ Here's some quick examples of how to add text buttons using Kaplay UI:
28
32
 
29
33
  ```javascript
30
34
  import kaplay from "kaplay";
31
35
  import "kaplay/global";
32
36
 
33
- import { addTextButton } from "kaplay-ui";
37
+ import { addTextButton } from "kaplay-ui/buttons";
34
38
 
35
39
  kaplay();
36
40
 
37
- // Add a UI button
38
- addTextButton("Start", () => go("main"));
41
+ // Add a text button
42
+ addTextButton("Start");
43
+
44
+ // Add a text button with an onClick handler
45
+ addTextButton("Start", () => go("game"));
46
+
47
+ // Add a text button with x and y position
48
+ addTextButton("Start", () => go("game"), 200, 200);
49
+
50
+ // Add a text button with width and height
51
+ addTextButton("Start", () => go("game"), 200, 200, 200, 70);
52
+
53
+ // Add a text button with text size
54
+ addTextButton("Start", () => go("game"), 200, 200, 200, 70, 20);
55
+
56
+ // Add a text button with disabled hover effect
57
+ addTextButton("Start", () => go("game"), 200, 200, 200, 70, 20, false);
39
58
  ```
40
59
 
41
60
  ## License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaplay-ui",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "UI components for KAPLAY",
5
5
  "main": "index.js",
6
6
  "repository": {