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.
Files changed (2) hide show
  1. package/README.md +16 -0
  2. 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:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaplay-ui",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "UI components for KAPLAY",
5
5
  "main": "index.js",
6
6
  "repository": {