kaplay-ui 0.15.2 → 0.15.3

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 +12 -28
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -28,34 +28,18 @@ npm install kaplay-ui
28
28
 
29
29
  #### Text Button
30
30
 
31
- Here's some quick examples of how to add text buttons using Kaplay UI:
32
-
33
- ```javascript
34
- import kaplay from "kaplay";
35
- import "kaplay/global";
36
-
37
- import { addTextButton } from "kaplay-ui/buttons";
38
-
39
- kaplay();
40
-
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);
58
- ```
31
+ Makes a button with centered text that takes the following parameters:
32
+
33
+ | Parameter | Type | Default | Required | Description |
34
+ | ------------ | -------- | ------- | -------- | ---------------------------------- |
35
+ | `text` | `string` | N/A | ✅ Yes | The text to display on the button. |
36
+ | `x` | `number` | 0 | ❌ No | Button x position |
37
+ | `y` | `number` | 0 | ❌ No | Button y position |
38
+ | `width` | `number` | 100 | ❌ No | Button width |
39
+ | `height` | `number` | 50 | ❌ No | Button height |
40
+ | `btnRadius` | `number` | 8 | ❌ No | Button radius |
41
+ | `btnOutline` | `number` | 1 | ❌ No | Button outline |
42
+ | `txtSize` | `number` | 15 | ❌ No | Text size |
59
43
 
60
44
  ## License
61
45
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaplay-ui",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "description": "UI components for KAPLAY",
5
5
  "main": "index.js",
6
6
  "repository": {