kaplay-ui 0.10.0 → 0.10.1
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 +16 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,6 +26,22 @@ npm install kaplay-ui
|
|
|
26
26
|
|
|
27
27
|
### Buttons
|
|
28
28
|
|
|
29
|
+
#### Icon Button
|
|
30
|
+
|
|
31
|
+
```javascript
|
|
32
|
+
import kaplay from "kaplay";
|
|
33
|
+
import "kaplay/global";
|
|
34
|
+
|
|
35
|
+
import { addIconButton } from "kaplay-ui/buttons";
|
|
36
|
+
|
|
37
|
+
kaplay();
|
|
38
|
+
|
|
39
|
+
loadSprite("arrow", "sprites/arrow.png");
|
|
40
|
+
|
|
41
|
+
// Add a text button with an onClick handler
|
|
42
|
+
addIconButton("arrow", () => go("game"));
|
|
43
|
+
```
|
|
44
|
+
|
|
29
45
|
#### Text Button
|
|
30
46
|
|
|
31
47
|
Here's some quick examples of how to add text buttons using Kaplay UI:
|