Update properties API docs

This commit is contained in:
Insality 2025-05-02 12:53:32 +03:00
parent 336694cd1d
commit 2b68117527
8 changed files with 812 additions and 0 deletions

View File

@ -0,0 +1,97 @@
# druid.widget.property_button API
> at /druid/widget/properties_panel/properties/property_button.lua
## Functions
- [init](#init)
- [on_click](#on_click)
- [set_text_property](#set_text_property)
- [set_text_button](#set_text_button)
- [set_color](#set_color)
## Fields
- [root](#root)
- [container](#container)
- [text_name](#text_name)
- [button](#button)
- [text_button](#text_button)
- [druid](#druid)
- [selected](#selected)
### init
---
```lua
property_button:init()
```
### on_click
---
```lua
property_button:on_click()
```
### set_text_property
---
```lua
property_button:set_text_property(text)
```
- **Parameters:**
- `text` *(string)*:
- **Returns:**
- `` *(druid.widget.property_button)*:
### set_text_button
---
```lua
property_button:set_text_button(text)
```
- **Parameters:**
- `text` *(string)*:
- **Returns:**
- `` *(druid.widget.property_button)*:
### set_color
---
```lua
property_button:set_color([color_value])
```
- **Parameters:**
- `[color_value]` *(any)*:
## Fields
<a name="root"></a>
- **root** (_node_)
<a name="container"></a>
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
<a name="text_name"></a>
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="button"></a>
- **button** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
<a name="text_button"></a>
- **text_button** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="druid"></a>
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="selected"></a>
- **selected** (_node_)

View File

@ -0,0 +1,111 @@
# druid.widget.property_checkbox API
> at /druid/widget/properties_panel/properties/property_checkbox.lua
## Functions
- [init](#init)
- [set_value](#set_value)
- [get_value](#get_value)
- [on_click](#on_click)
- [set_text_property](#set_text_property)
- [on_change](#on_change)
## Fields
- [root](#root)
- [druid](#druid)
- [text_name](#text_name)
- [button](#button)
- [selected](#selected)
- [icon](#icon)
- [container](#container)
- [on_change_value](#on_change_value)
### init
---
```lua
property_checkbox:init()
```
### set_value
---
```lua
property_checkbox:set_value(value, [is_instant])
```
- **Parameters:**
- `value` *(boolean)*:
- `[is_instant]` *(any)*:
### get_value
---
```lua
property_checkbox:get_value()
```
- **Returns:**
- `` *(boolean)*:
### on_click
---
```lua
property_checkbox:on_click()
```
### set_text_property
---
```lua
property_checkbox:set_text_property(text)
```
Set the text property of the checkbox
- **Parameters:**
- `text` *(string)*:
### on_change
---
```lua
property_checkbox:on_change(callback)
```
Set the callback function for when the checkbox value changes
- **Parameters:**
- `callback` *(function)*:
## Fields
<a name="root"></a>
- **root** (_node_)
<a name="druid"></a>
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="text_name"></a>
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="button"></a>
- **button** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
<a name="selected"></a>
- **selected** (_node_)
<a name="icon"></a>
- **icon** (_node_)
<a name="container"></a>
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
<a name="on_change_value"></a>
- **on_change_value** (_unknown_)

View File

@ -0,0 +1,90 @@
# druid.widget.property_input API
> at /druid/widget/properties_panel/properties/property_input.lua
## Functions
- [init](#init)
- [set_text_property](#set_text_property)
- [set_text_value](#set_text_value)
- [on_change](#on_change)
## Fields
- [root](#root)
- [container](#container)
- [text_name](#text_name)
- [button](#button)
- [druid](#druid)
- [selected](#selected)
- [rich_input](#rich_input)
### init
---
```lua
property_input:init()
```
### set_text_property
---
```lua
property_input:set_text_property(text)
```
- **Parameters:**
- `text` *(string)*:
- **Returns:**
- `` *(druid.widget.property_input)*:
### set_text_value
---
```lua
property_input:set_text_value(text)
```
- **Parameters:**
- `text` *(string|number)*:
- **Returns:**
- `` *(druid.widget.property_input)*:
### on_change
---
```lua
property_input:on_change(callback, [callback_context])
```
- **Parameters:**
- `callback` *(fun(self: druid.widget.property_input, text: string))*:
- `[callback_context]` *(any)*:
## Fields
<a name="root"></a>
- **root** (_node_)
<a name="container"></a>
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
<a name="text_name"></a>
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="button"></a>
- **button** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
<a name="druid"></a>
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="selected"></a>
- **selected** (_node_)
<a name="rich_input"></a>
- **rich_input** (_druid.rich_input_): The component that handles a rich text input field, it's a wrapper around the druid.input component

View File

@ -0,0 +1,171 @@
# druid.widget.property_left_right_selector API
> at /druid/widget/properties_panel/properties/property_left_right_selector.lua
## Functions
- [init](#init)
- [set_text](#set_text)
- [on_button_left](#on_button_left)
- [on_button_right](#on_button_right)
- [add_step](#add_step)
- [set_number_type](#set_number_type)
- [set_array_type](#set_array_type)
- [set_value](#set_value)
- [get_value](#get_value)
## Fields
- [root](#root)
- [druid](#druid)
- [text_name](#text_name)
- [button](#button)
- [selected](#selected)
- [value](#value)
- [on_change_value](#on_change_value)
- [text_value](#text_value)
- [button_left](#button_left)
- [button_right](#button_right)
- [container](#container)
- [number_type](#number_type)
- [array_type](#array_type)
### init
---
```lua
property_left_right_selector:init()
```
### set_text
---
```lua
property_left_right_selector:set_text([text])
```
- **Parameters:**
- `[text]` *(any)*:
- **Returns:**
- `` *(druid.widget.property_left_right_selector)*:
### on_button_left
---
```lua
property_left_right_selector:on_button_left()
```
### on_button_right
---
```lua
property_left_right_selector:on_button_right()
```
### add_step
---
```lua
property_left_right_selector:add_step(koef)
```
- **Parameters:**
- `koef` *(number)*: -1 0 1, on 0 will not move
### set_number_type
---
```lua
property_left_right_selector:set_number_type([min], [max], [is_loop], [steps])
```
- **Parameters:**
- `[min]` *(any)*:
- `[max]` *(any)*:
- `[is_loop]` *(any)*:
- `[steps]` *(any)*:
- **Returns:**
- `` *(druid.widget.property_left_right_selector)*:
### set_array_type
---
```lua
property_left_right_selector:set_array_type([array], [is_loop], [steps])
```
- **Parameters:**
- `[array]` *(any)*:
- `[is_loop]` *(any)*:
- `[steps]` *(any)*:
- **Returns:**
- `` *(druid.widget.property_left_right_selector)*:
### set_value
---
```lua
property_left_right_selector:set_value(value, [is_instant])
```
- **Parameters:**
- `value` *(string|number)*:
- `[is_instant]` *(any)*:
### get_value
---
```lua
property_left_right_selector:get_value()
```
- **Returns:**
- `` *(string|number)*:
## Fields
<a name="root"></a>
- **root** (_node_)
<a name="druid"></a>
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="text_name"></a>
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="button"></a>
- **button** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
<a name="selected"></a>
- **selected** (_node_)
<a name="value"></a>
- **value** (_string_)
<a name="on_change_value"></a>
- **on_change_value** (_event_): fun(value: string|number)
<a name="text_value"></a>
- **text_value** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="button_left"></a>
- **button_left** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
<a name="button_right"></a>
- **button_right** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
<a name="container"></a>
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
<a name="number_type"></a>
- **number_type** (_table_)
<a name="array_type"></a>
- **array_type** (_table_)

View File

@ -0,0 +1,150 @@
# druid.widget.property_slider API
> at /druid/widget/properties_panel/properties/property_slider.lua
## Functions
- [init](#init)
- [set_text_function](#set_text_function)
- [set_text_property](#set_text_property)
- [on_change](#on_change)
- [set_value](#set_value)
- [get_value](#get_value)
- [update_value](#update_value)
- [set_number_type](#set_number_type)
## Fields
- [root](#root)
- [container](#container)
- [druid](#druid)
- [text_name](#text_name)
- [text_value](#text_value)
- [slider](#slider)
- [on_change_value](#on_change_value)
- [selected](#selected)
- [min](#min)
- [max](#max)
- [step](#step)
### init
---
```lua
property_slider:init()
```
### set_text_function
---
```lua
property_slider:set_text_function(callback)
```
- **Parameters:**
- `callback` *(fun(value: number):string)*:
### set_text_property
---
```lua
property_slider:set_text_property(text)
```
Sets the text property of the slider
- **Parameters:**
- `text` *(string)*:
### on_change
---
```lua
property_slider:on_change(callback)
```
Sets the callback function for when the slider value changes
- **Parameters:**
- `callback` *(fun(value: number))*:
### set_value
---
```lua
property_slider:set_value(value, [is_instant])
```
- **Parameters:**
- `value` *(number)*:
- `[is_instant]` *(any)*:
### get_value
---
```lua
property_slider:get_value()
```
- **Returns:**
- `` *(number)*:
### update_value
---
```lua
property_slider:update_value([value])
```
- **Parameters:**
- `[value]` *(any)*:
### set_number_type
---
```lua
property_slider:set_number_type([min], [max], [step])
```
- **Parameters:**
- `[min]` *(any)*:
- `[max]` *(any)*:
- `[step]` *(any)*:
## Fields
<a name="root"></a>
- **root** (_node_)
<a name="container"></a>
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
<a name="druid"></a>
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="text_name"></a>
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="text_value"></a>
- **text_value** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="slider"></a>
- **slider** (_druid.slider_): Basic Druid slider component. Creates a draggable node over a line with progress reporting.
<a name="on_change_value"></a>
- **on_change_value** (_event_): fun(value:number)
<a name="selected"></a>
- **selected** (_node_)
<a name="min"></a>
- **min** (_integer_)
<a name="max"></a>
- **max** (_integer_)
<a name="step"></a>
- **step** (_number_)

View File

@ -0,0 +1,66 @@
# druid.widget.property_text API
> at /druid/widget/properties_panel/properties/property_text.lua
## Functions
- [init](#init)
- [set_text_property](#set_text_property)
- [set_text_value](#set_text_value)
## Fields
- [root](#root)
- [container](#container)
- [text_name](#text_name)
- [text_right](#text_right)
### init
---
```lua
property_text:init()
```
### set_text_property
---
```lua
property_text:set_text_property(text)
```
- **Parameters:**
- `text` *(string)*:
- **Returns:**
- `` *(druid.widget.property_text)*:
### set_text_value
---
```lua
property_text:set_text_value([text])
```
- **Parameters:**
- `[text]` *(string|nil)*:
- **Returns:**
- `` *(druid.widget.property_text)*:
## Fields
<a name="root"></a>
- **root** (_node_)
<a name="container"></a>
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
<a name="text_name"></a>
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="text_right"></a>
- **text_right** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.

View File

@ -0,0 +1,104 @@
# druid.widget.property_vector3 API
> at /druid/widget/properties_panel/properties/property_vector3.lua
## Functions
- [init](#init)
- [set_text_property](#set_text_property)
- [set_value](#set_value)
## Fields
- [root](#root)
- [container](#container)
- [text_name](#text_name)
- [button](#button)
- [druid](#druid)
- [selected_x](#selected_x)
- [selected_y](#selected_y)
- [selected_z](#selected_z)
- [rich_input_x](#rich_input_x)
- [rich_input_y](#rich_input_y)
- [rich_input_z](#rich_input_z)
- [value](#value)
- [on_change](#on_change)
### init
---
```lua
property_vector3:init()
```
### set_text_property
---
```lua
property_vector3:set_text_property(text)
```
- **Parameters:**
- `text` *(string)*:
- **Returns:**
- `` *(druid.widget.property_vector3)*:
### set_value
---
```lua
property_vector3:set_value(x, y, z)
```
- **Parameters:**
- `x` *(number)*:
- `y` *(number)*:
- `z` *(number)*:
- **Returns:**
- `` *(druid.widget.property_vector3)*:
## Fields
<a name="root"></a>
- **root** (_node_)
<a name="container"></a>
- **container** (_druid.container_): Druid component to manage the size and positions with other containers relations to create a adaptable layouts.
<a name="text_name"></a>
- **text_name** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
<a name="button"></a>
- **button** (_druid.button_): Basic Druid input component. Handle input on node and provide different callbacks on touch events.
<a name="druid"></a>
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="selected_x"></a>
- **selected_x** (_node_)
<a name="selected_y"></a>
- **selected_y** (_node_)
<a name="selected_z"></a>
- **selected_z** (_node_)
<a name="rich_input_x"></a>
- **rich_input_x** (_druid.rich_input_): The component that handles a rich text input field, it's a wrapper around the druid.input component
<a name="rich_input_y"></a>
- **rich_input_y** (_druid.rich_input_): The component that handles a rich text input field, it's a wrapper around the druid.input component
<a name="rich_input_z"></a>
- **rich_input_z** (_druid.rich_input_): The component that handles a rich text input field, it's a wrapper around the druid.input component
<a name="value"></a>
- **value** (_unknown_)
<a name="on_change"></a>
- **on_change** (_unknown_)

View File

@ -2,6 +2,15 @@
> at /druid/widget/properties_panel/properties_panel.lua > at /druid/widget/properties_panel/properties_panel.lua
# Properties API:
- [property_button](properties_panel/property_button_api.md)
- [property_checkbox](properties_panel/property_checkbox_api.md)
- [property_slider](properties_panel/property_slider_api.md)
- [property_input](properties_panel/property_input_api.md)
- [property_text](properties_panel/property_text_api.md)
- [property_left_right_selector](properties_panel/property_left_right_selector_api.md)
- [property_vector3](properties_panel/property_vector3_api.md)
## Functions ## Functions
- [properties_constructors](#properties_constructors) - [properties_constructors](#properties_constructors)
@ -130,6 +139,8 @@ properties_panel:update([dt])
properties_panel:add_checkbox([on_create]) properties_panel:add_checkbox([on_create])
``` ```
Inspect Property Checkbox API [here](properties_panel/property_checkbox_api.md)
- **Parameters:** - **Parameters:**
- `[on_create]` *(fun(checkbox: druid.widget.property_checkbox)|nil)*: - `[on_create]` *(fun(checkbox: druid.widget.property_checkbox)|nil)*:
@ -143,6 +154,8 @@ properties_panel:add_checkbox([on_create])
properties_panel:add_slider([on_create]) properties_panel:add_slider([on_create])
``` ```
Inspect Property Slider API [here](properties_panel/property_slider_api.md)
- **Parameters:** - **Parameters:**
- `[on_create]` *(fun(slider: druid.widget.property_slider)|nil)*: - `[on_create]` *(fun(slider: druid.widget.property_slider)|nil)*:
@ -156,6 +169,8 @@ properties_panel:add_slider([on_create])
properties_panel:add_button([on_create]) properties_panel:add_button([on_create])
``` ```
Inspect Property Button API [here](properties_panel/property_button_api.md)
- **Parameters:** - **Parameters:**
- `[on_create]` *(fun(button: druid.widget.property_button)|nil)*: - `[on_create]` *(fun(button: druid.widget.property_button)|nil)*:
@ -169,6 +184,8 @@ properties_panel:add_button([on_create])
properties_panel:add_input([on_create]) properties_panel:add_input([on_create])
``` ```
Inspect Property Input API [here](properties_panel/property_input_api.md)
- **Parameters:** - **Parameters:**
- `[on_create]` *(fun(input: druid.widget.property_input)|nil)*: - `[on_create]` *(fun(input: druid.widget.property_input)|nil)*:
@ -182,6 +199,8 @@ properties_panel:add_input([on_create])
properties_panel:add_text([on_create]) properties_panel:add_text([on_create])
``` ```
Inspect Property Text API [here](properties_panel/property_text_api.md)
- **Parameters:** - **Parameters:**
- `[on_create]` *(fun(text: druid.widget.property_text)|nil)*: - `[on_create]` *(fun(text: druid.widget.property_text)|nil)*:
@ -195,6 +214,8 @@ properties_panel:add_text([on_create])
properties_panel:add_left_right_selector([on_create]) properties_panel:add_left_right_selector([on_create])
``` ```
Inspect Property Left Right Selector API [here](properties_panel/property_left_right_selector_api.md)
- **Parameters:** - **Parameters:**
- `[on_create]` *(fun(selector: druid.widget.property_left_right_selector)|nil)*: - `[on_create]` *(fun(selector: druid.widget.property_left_right_selector)|nil)*:
@ -208,6 +229,8 @@ properties_panel:add_left_right_selector([on_create])
properties_panel:add_vector3([on_create]) properties_panel:add_vector3([on_create])
``` ```
Inspect Property Vector3 API [here](properties_panel/property_vector3_api.md)
- **Parameters:** - **Parameters:**
- `[on_create]` *(fun(vector3: druid.widget.property_vector3)|nil)*: - `[on_create]` *(fun(vector3: druid.widget.property_vector3)|nil)*: