Skip to content

Commit c33dbd5

Browse files
committed
Update API pages
1 parent 6e1998b commit c33dbd5

24 files changed

+82
-460
lines changed

api/components/base/back_handler_api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The Back Handler constructor
3838

3939
## Fields
4040
<a name="on_back"></a>
41-
- **on_back** (_event_): Trigger on back handler action, fun(self, params)
41+
- **on_back** (_event_): fun(self: druid.back_handler, params: any?) Trigger on back handler action
4242

4343
<a name="params"></a>
4444
- **params** (_any_): Custom args to pass in the callback

api/components/base/button_api.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ button:is_enabled()
112112
```
113113

114114
Get button enabled state.
115-
By default all Buttons is enabled on creating.
115+
By default all Buttons are enabled on creating.
116116

117117
- **Returns:**
118-
- `is_enabled` *(boolean)*: True, if button is enabled now, False overwise
118+
- `is_enabled` *(boolean)*: True, if button is enabled now, False otherwise
119119

120120
### set_click_zone
121121

@@ -125,7 +125,7 @@ button:set_click_zone([zone])
125125
```
126126

127127
Set additional button click area.
128-
Useful to restrict click outside out stencil node or scrollable content.
128+
Useful to restrict click outside of stencil node or scrollable content.
129129
If button node placed inside stencil node, it will be automatically set to this stencil node.
130130

131131
- **Parameters:**
@@ -168,11 +168,11 @@ Get current key name to trigger this button.
168168
button:set_check_function([check_function], [failure_callback])
169169
```
170170

171-
Set function for additional check for button click availability
171+
Set function for additional check for button click availability.
172172

173173
- **Parameters:**
174174
- `[check_function]` *(function|nil)*: Should return true or false. If true - button can be pressed.
175-
- `[failure_callback]` *(function|nil)*: Function will be called on button click, if check function return false
175+
- `[failure_callback]` *(function|nil)*: Function will be called on button click, if check function returns false
176176

177177
- **Returns:**
178178
- `self` *(druid.button)*: The current button instance
@@ -186,7 +186,7 @@ button:set_web_user_interaction([is_web_mode])
186186

187187
Set Button mode to work inside user HTML5 interaction event.
188188
It's required to make protected things like copy & paste text, show mobile keyboard, etc
189-
The HTML5 button's doesn't call any events except on_click event.
189+
The HTML5 button doesn't call any events except on_click event.
190190
If the game is not HTML, html mode will be not enabled
191191

192192
- **Parameters:**
@@ -198,25 +198,25 @@ If the game is not HTML, html mode will be not enabled
198198

199199
## Fields
200200
<a name="on_click"></a>
201-
- **on_click** (_event_): function(self, custom_args, button_instance)
201+
- **on_click** (_event_): fun(self, custom_args, button_instance)
202202

203203
<a name="on_pressed"></a>
204-
- **on_pressed** (_event_): function(self, custom_args, button_instance)
204+
- **on_pressed** (_event_): fun(self, custom_args, button_instance)
205205

206206
<a name="on_repeated_click"></a>
207-
- **on_repeated_click** (_event_): function(self, custom_args, button_instance, click_count) Repeated click callback, while holding the button
207+
- **on_repeated_click** (_event_): fun(self, custom_args, button_instance, click_count) Repeated click callback, while holding the button
208208

209209
<a name="on_long_click"></a>
210-
- **on_long_click** (_event_): function(self, custom_args, button_instance, hold_time) Callback on long button tap
210+
- **on_long_click** (_event_): fun(self, custom_args, button_instance, hold_time) Callback on long button tap
211211

212212
<a name="on_double_click"></a>
213-
- **on_double_click** (_event_): function(self, custom_args, button_instance, click_amount) Different callback, if tap button 2+ in row
213+
- **on_double_click** (_event_): fun(self, custom_args, button_instance, click_amount) Different callback, if tap button 2+ in row
214214

215215
<a name="on_hold_callback"></a>
216-
- **on_hold_callback** (_event_): function(self, custom_args, button_instance, press_time) Hold callback, before long_click trigger
216+
- **on_hold_callback** (_event_): fun(self, custom_args, button_instance, press_time) Hold callback, before long_click trigger
217217

218218
<a name="on_click_outside"></a>
219-
- **on_click_outside** (_event_): function(self, custom_args, button_instance)
219+
- **on_click_outside** (_event_): fun(self, custom_args, button_instance)
220220

221221
<a name="node"></a>
222222
- **node** (_node_): Clickable node

api/components/base/component_api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,13 @@ Get full template name.
243243

244244
---
245245
```lua
246-
component:set_nodes(nodes)
246+
component:set_nodes([nodes])
247247
```
248248

249249
Set current component nodes, returned from `gui.clone_tree` function.
250250

251251
- **Parameters:**
252-
- `nodes` *(table<hash, node>)*:
252+
- `[nodes]` *(string|node|table<hash, node>|nil)*: The nodes table from gui.clone_tree or prefab node to use for clone or node id to clone
253253

254254
- **Returns:**
255255
- `` *(druid.component)*:
@@ -292,7 +292,7 @@ Get Druid instance for inner component creation.
292292

293293
- **Parameters:**
294294
- `[template]` *(string|nil)*:
295-
- `[nodes]` *(table<hash, node>|nil)*:
295+
- `[nodes]` *(string|node|table<hash, node>|nil)*: The nodes table from gui.clone_tree or prefab node to use for clone or node id to clone
296296

297297
- **Returns:**
298298
- `` *(druid.instance)*:

api/components/base/scroll_api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,13 +334,13 @@ Strict drag scroll area. Useful for
334334
- **click_zone** (_node_): Optional click zone to restrict scroll area
335335

336336
<a name="on_scroll"></a>
337-
- **on_scroll** (_event_): Triggered on scroll move with fun(self, position)
337+
- **on_scroll** (_event_): fun(self: druid.scroll, position: vector3) Triggered on scroll move
338338

339339
<a name="on_scroll_to"></a>
340-
- **on_scroll_to** (_event_): Triggered on scroll_to with fun(self, target, is_instant)
340+
- **on_scroll_to** (_event_): fun(self: druid.scroll, target: vector3, is_instant: boolean) Triggered on scroll_to
341341

342342
<a name="on_point_scroll"></a>
343-
- **on_point_scroll** (_event_): Triggered on scroll_to_index with fun(self, index, point)
343+
- **on_point_scroll** (_event_): fun(self: druid.scroll, index: number, point: vector3) Triggered on scroll_to_index
344344

345345
<a name="view_node"></a>
346346
- **view_node** (_node_): The scroll view node (static part)

0 commit comments

Comments
 (0)