kaplay-ui 0.20.0 → 0.20.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 +38 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -114,6 +114,8 @@ A switch can take the following parameters:
114
114
  | `width` | `number` | 50 | ❌ No | Switch width |
115
115
  | `height` | `number` | 25 | ❌ No | Switch height |
116
116
 
117
+ <br>
118
+
117
119
  #### Text Button
118
120
 
119
121
  To make a text button, one must use the exported <code>makeTextButton()</code> function.
@@ -152,6 +154,42 @@ A text button can take the following parameters:
152
154
 
153
155
  <br>
154
156
 
157
+ #### Text input
158
+
159
+ To make a toggle, one must use the exported <code>makeTextInput()</code> function.
160
+
161
+ ##### Example
162
+
163
+ An example usage of a toggle.
164
+
165
+ ```javascript
166
+ import kaplay from "kaplay";
167
+ import "kaplay/global";
168
+
169
+ import { makeTextInput } from "kaplay-ui/inputs";
170
+
171
+ kaplay();
172
+
173
+ const txtInput = makeTextInput();
174
+
175
+ add(txtInput);
176
+ ```
177
+
178
+ ##### Parameters
179
+
180
+ A text input can take the following parameters:
181
+
182
+ | Parameter | Type | Default | Required | Description |
183
+ | ---------- | --------- | ------- | -------- | ------------------------------ |
184
+ | `x` | `number` | 0 | ❌ No | x position |
185
+ | `y` | `number` | 0 | ❌ No | y position |
186
+ | `width` | `number` | 400 | ❌ No | width |
187
+ | `txtSize` | `number` | 15 | ❌ No | Input text size |
188
+ | `pad` | `number` | 10 | ❌ No | Padding |
189
+ | `hasFocus` | `boolean` | true | ❌ No | If text input has focus or not |
190
+
191
+ <br>
192
+
155
193
  #### Toggle
156
194
 
157
195
  To make a toggle, one must use the exported <code>makeToggle()</code> function.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaplay-ui",
3
- "version": "0.20.0",
3
+ "version": "0.20.1",
4
4
  "description": "UI components for KAPLAY",
5
5
  "main": "index.js",
6
6
  "repository": {