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.
- package/README.md +12 -28
- 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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
|