mirror of
https://github.com/Insality/druid
synced 2025-06-27 10:27:48 +02:00
Update docs
This commit is contained in:
parent
d2fcb1aa85
commit
40c3609162
@ -101,6 +101,8 @@ druid.on_window_callback(event)
|
||||
|
||||
- **[Dynamic Grid](docs_md/01-components.md#dynamic-grid)** - Component to manage node positions with different sizes. Only in one row or column
|
||||
|
||||
- **[Dynamic Grid](docs_md/01-components.md#data-list)** - Component to manage data for huge dataset in scroll
|
||||
|
||||
- **[Input](docs_md/01-components.md#input)** - User text input component
|
||||
|
||||
- **[Lang text](docs_md/01-components.md#lang-text)** - Wrap on Text component to handle localization
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
## Button
|
||||
[Button API here](https://insality.github.io/druid/modules/druid.button.html)
|
||||
[Button API here](https://insality.github.io/druid/modules/Button.html)
|
||||
|
||||
### Overview
|
||||
Basic Druid input component. Handle input on node and provide different callbacks on touch events.
|
||||
@ -36,7 +36,7 @@ _fill example usecases_
|
||||
|
||||
|
||||
## Text
|
||||
[Text API here](https://insality.github.io/druid/modules/druid.text.html)
|
||||
[Text API here](https://insality.github.io/druid/modules/Text.html)
|
||||
|
||||
### Overview
|
||||
Basic Druid text component. Text components by default have the text size adjusting.
|
||||
@ -55,7 +55,7 @@ Create text node with druid: `text = druid:new_text(node_name, [initial_value],
|
||||
|
||||
|
||||
## Blocker
|
||||
[Blocker API here](https://insality.github.io/druid/modules/druid.blocker.html)
|
||||
[Blocker API here](https://insality.github.io/druid/modules/Blocker.html)
|
||||
|
||||
### Overview
|
||||
Druid component for block input. Use it to block input in special zone.
|
||||
@ -75,7 +75,7 @@ So you can do the safe zones, when you have the big buttons
|
||||
|
||||
|
||||
## Back Handler
|
||||
[Back handler API here](https://insality.github.io/druid/modules/druid.back_handler.html)
|
||||
[Back handler API here](https://insality.github.io/druid/modules/BackHandler.html)
|
||||
|
||||
### Overview
|
||||
Component to handle back button. It handle Android back button and Backspace key. Key triggers in `input.binding` should be setup for correct working.
|
||||
@ -87,7 +87,7 @@ Setup callback with `druid:new_back_handler(callback)`
|
||||
|
||||
|
||||
## Lang text
|
||||
[Lang text API here](https://insality.github.io/druid/modules/druid.lang_text.html)
|
||||
[Lang text API here](https://insality.github.io/druid/modules/LangText.html)
|
||||
|
||||
### Overview
|
||||
Wrap on Text component to handle localization. It uses druid get_text_function to set text by it's id
|
||||
@ -99,7 +99,7 @@ Create lang text component with druid `text = druid:new_lang_text(node_name, loc
|
||||
|
||||
|
||||
## Scroll
|
||||
[Scroll API here](https://insality.github.io/druid/modules/druid.scroll.html)
|
||||
[Scroll API here](https://insality.github.io/druid/modules/Scroll.html)
|
||||
|
||||
### Overview
|
||||
Basic Druid scroll component. Handle all scrolling stuff in druid GUI
|
||||
@ -120,7 +120,7 @@ Usually, Place _view_node_ and as children add _content_node_:
|
||||
*Here content_node below view_node, in game content_node be able to scroll left until end*
|
||||
|
||||
### Notes
|
||||
- Scroll by default style have inertion and extra size for strecthing effect. It can be adjust via scroll [style settings](https://insality.github.io/druid/modules/druid.scroll.html#Style)
|
||||
- Scroll by default style have inertion and extra size for strecthing effect. It can be adjust via scroll [style settings](https://insality.github.io/druid/modules/Scroll.html#Style)
|
||||
- You can setup "points of interest". Scroll always will be centered on closes point of interest. It is able to create slider without inertion and points of interest on each scroll element.
|
||||
- Scroll have next events:
|
||||
- *on_scroll* (self, position) On scroll move callback
|
||||
@ -133,7 +133,7 @@ Usually, Place _view_node_ and as children add _content_node_:
|
||||
|
||||
|
||||
## Progress
|
||||
[Progress API here](https://insality.github.io/druid/modules/druid.progress.html)
|
||||
[Progress API here](https://insality.github.io/druid/modules/Progress.html)
|
||||
|
||||
### Overview
|
||||
Basic Druid progress bar component
|
||||
@ -151,7 +151,7 @@ Key is value from druid const: const.SIDE.X (or just "x") or const.SIDE.Y (or ju
|
||||
|
||||
|
||||
## Slider
|
||||
[Slider API here](https://insality.github.io/druid/modules/druid.slider.html)
|
||||
[Slider API here](https://insality.github.io/druid/modules/Slider.html)
|
||||
|
||||
### Overview
|
||||
Basic Druid slider component
|
||||
@ -167,7 +167,7 @@ Pin node (node_name in params) should be placed in zero position (initial). It w
|
||||
|
||||
|
||||
## Input
|
||||
[Input API here](https://insality.github.io/druid/modules/druid.input.html)
|
||||
[Input API here](https://insality.github.io/druid/modules/Input.html)
|
||||
|
||||
### Overview
|
||||
Basic Druid text input component
|
||||
@ -187,7 +187,7 @@ Create input component with druid: `input = druid:new_input(button_node_name, te
|
||||
|
||||
|
||||
## Checkbox
|
||||
[Checkbox API here](https://insality.github.io/druid/modules/druid.checkbox.html)
|
||||
[Checkbox API here](https://insality.github.io/druid/modules/Checkbox.html)
|
||||
|
||||
### Overview
|
||||
Basic Druid checkbox component.
|
||||
@ -201,7 +201,7 @@ Create checkbox component with druid: `checkbox = druid:new_checkbox(node, callb
|
||||
|
||||
|
||||
## Checkbox group
|
||||
[Checkbox group API here](https://insality.github.io/druid/modules/druid.checkbox_group.html)
|
||||
[Checkbox group API here](https://insality.github.io/druid/modules/CheckboxGroup.html)
|
||||
|
||||
### Overview
|
||||
Several checkboxes in one group
|
||||
@ -215,7 +215,7 @@ Create checkbox_group component with druid: `group = druid:new_checkbox_group(no
|
||||
|
||||
|
||||
## Radio group
|
||||
[Radio group API here](https://insality.github.io/druid/modules/druid.radio_group.html)
|
||||
[Radio group API here](https://insality.github.io/druid/modules/RadioGroup.html)
|
||||
|
||||
### Overview
|
||||
Several checkboxes in one group with single choice
|
||||
@ -230,7 +230,7 @@ Create radio_group component with druid: `group = druid:new_radio_group(nodes[],
|
||||
|
||||
|
||||
## Timer
|
||||
[Timer API here](https://insality.github.io/druid/modules/druid.timer.html)
|
||||
[Timer API here](https://insality.github.io/druid/modules/Timer.html)
|
||||
|
||||
### Overview
|
||||
Handle timer work on gui text node
|
||||
@ -245,7 +245,7 @@ Create timer component with druid: `timer = druid:new_timer(text_node, from_seco
|
||||
|
||||
|
||||
## Static Grid
|
||||
[Static Grid API here](https://insality.github.io/druid/modules/druid.static_grid.html)
|
||||
[Static Grid API here](https://insality.github.io/druid/modules/StaticGrid.html)
|
||||
|
||||
### Overview
|
||||
Component for manage node positions.
|
||||
@ -266,7 +266,7 @@ Create component with druid: `grid = druid:new_static_grid(parent_node, prefab_
|
||||
|
||||
|
||||
## Dynamic Grid
|
||||
[Dynamic Grid API here](https://insality.github.io/druid/modules/druid.dynamic_grid.html)
|
||||
[Dynamic Grid API here](https://insality.github.io/druid/modules/DynamicGrid.html)
|
||||
|
||||
### Overview
|
||||
Component for manage node positions with different node sizes.
|
||||
@ -276,7 +276,7 @@ Dynamic Grid can't have gaps between elements
|
||||
Dynamic Grid should have __West__, __East__, __South__ or __North__ pivot (vertical or horizontal element placement)
|
||||
|
||||
### Setup
|
||||
Create component with druid: `grid = druid:new_dynamic_grid(parent_node)`
|
||||
Create component with druid: `grid = druid:new_dynamic_grid(parent_node)`
|
||||
|
||||
Check the _parent_node_ have correct pivot point. You will get the error otherwise.
|
||||
|
||||
@ -290,8 +290,34 @@ Check the _parent_node_ have correct pivot point. You will get the error otherwi
|
||||
- First node placed at Grid pivot point. Other nodes placed nearby of other nodes.
|
||||
- On *add/remove* nodes always shifted. You can point the shift side in this functions (*is_shift_left* boolean argumentp
|
||||
|
||||
|
||||
## Data List
|
||||
[Data List API here](https://insality.github.io/druid/modules/DataList.html)
|
||||
|
||||
### Overview
|
||||
Component to manage data for huge dataset in scroll. DataList create elements only in scroll view.
|
||||
It requires Druid Scroll and Druid Grid (Static or Dynamic) components
|
||||
|
||||
|
||||
### Setup
|
||||
Create component with druid: `grid = druid:new_data_list(scroll, grid, create_callback)`
|
||||
- scroll - already created Scroll component
|
||||
- grid - already created StaticGrid or DynamicGrid component
|
||||
- create_function - your function to create node instances. This callback have next parameters: fun(self, data, index, data_list)
|
||||
- self - Script/Druid context
|
||||
- data- your element data
|
||||
- index - element index
|
||||
- data_list - current DataList component
|
||||
|
||||
Create function should return root node and optionaly, Druid component. It’s required to manage create/remove lifecycle.
|
||||
|
||||
### Notes
|
||||
- Set data with `data_list:set_data({...})` after component initialize
|
||||
- You can use `data_list:scroll_to_index()` function to show data element
|
||||
|
||||
|
||||
## Hover
|
||||
[Hover API here](https://insality.github.io/druid/modules/druid.hover.html)
|
||||
[Hover API here](https://insality.github.io/druid/modules/Hover.html)
|
||||
|
||||
### Overview
|
||||
System Druid component, handle hover node state.
|
||||
@ -306,7 +332,7 @@ Create hover component with druid: `hover = druid:new_hover(node, callback)`
|
||||
|
||||
|
||||
## Swipe
|
||||
[Swipe API here](https://insality.github.io/druid/modules/druid.swipe.html)
|
||||
[Swipe API here](https://insality.github.io/druid/modules/Swipe.html)
|
||||
|
||||
### Overview
|
||||
System Druid component, handle swipe actions on node
|
||||
@ -327,7 +353,7 @@ Create swipe component with druid: `hover = druid:new_swipe(node, swipe_callback
|
||||
|
||||
|
||||
## Drag
|
||||
[Drag API here](https://insality.github.io/druid/modules/druid.drag.html)
|
||||
[Drag API here](https://insality.github.io/druid/modules/Drag.html)
|
||||
|
||||
### Overview
|
||||
System Druid component, handle drag actions on node
|
||||
|
Loading…
x
Reference in New Issue
Block a user