Reimport docs

This commit is contained in:
Insality
2025-03-18 22:00:51 +02:00
parent 3c063313de
commit 44b735adda
31 changed files with 617 additions and 869 deletions

View File

@@ -2,6 +2,8 @@
> at /druid/custom/rich_input/rich_input.lua
The component that handles a rich text input field, it's a wrapper around the druid.input component
## Functions
- [init](#init)
@@ -68,7 +70,7 @@ Set placeholder text
- `placeholder_text` *(string)*: The placeholder text
- **Returns:**
- `` *(druid.rich_input)*:
- `self` *(druid.rich_input)*: Current instance
### select
@@ -79,6 +81,9 @@ rich_input:select()
Select input field
- **Returns:**
- `self` *(druid.rich_input)*: Current instance
### set_text
---
@@ -136,27 +141,27 @@ Set allowed charaters for input field.
- `characters` *(string)*: Regulax exp. for validate user input
- **Returns:**
- `Current` *(druid.rich_input)*: instance
- `self` *(druid.rich_input)*: Current instance
## Fields
<a name="root"></a>
- **root** (_node_)
- **root** (_node_): The root node of the rich input
<a name="input"></a>
- **input** (_druid.input_)
- **input** (_druid.input_): The input component
<a name="cursor"></a>
- **cursor** (_node_)
- **cursor** (_node_): The cursor node
<a name="cursor_text"></a>
- **cursor_text** (_node_)
- **cursor_text** (_node_): The cursor text node
<a name="cursor_position"></a>
- **cursor_position** (_vector3_)
- **cursor_position** (_vector3_): The position of the cursor
<a name="druid"></a>
- **druid** (_druid.instance_)
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="is_lshift"></a>
- **is_lshift** (_boolean_)
@@ -168,10 +173,10 @@ Set allowed charaters for input field.
- **is_button_input_enabled** (_unknown_)
<a name="drag"></a>
- **drag** (_druid.drag_)
- **drag** (_druid.drag_): A component that allows you to subscribe to drag events over a node
<a name="placeholder"></a>
- **placeholder** (_druid.text_)
- **placeholder** (_druid.text_): The component to handle text behaviour over a GUI Text node, mainly used to automatically adjust text size to fit the text area
<a name="text_position"></a>
- **text_position** (_unknown_)

View File

@@ -2,17 +2,15 @@
> at /druid/custom/rich_text/rich_text.lua
The component that handles a rich text display, allows to custom color, size, font, etc. of the parts of the text
## Functions
- [init](#init)
- [on_layout_change](#on_layout_change)
- [on_style_change](#on_style_change)
- [set_text](#set_text)
- [get_text](#get_text)
- [on_remove](#on_remove)
- [clear](#clear)
- [tagged](#tagged)
- [characters](#characters)
- [get_words](#get_words)
- [get_line_metric](#get_line_metric)
@@ -35,23 +33,6 @@ rich_text:init(text_node, [value])
- `text_node` *(string|node)*: The text node to make Rich Text
- `[value]` *(string|nil)*: The initial text value. Default will be gui.get_text(text_node)
### on_layout_change
---
```lua
rich_text:on_layout_change()
```
### on_style_change
---
```lua
rich_text:on_style_change(style)
```
- **Parameters:**
- `style` *(druid.rich_text.style)*:
### set_text
---
@@ -98,17 +79,10 @@ rich_text:set_text("img=texture:image,width,heightDisplay image with width
rich_text:get_text()
```
Get current text
Get the current text of the rich text
- **Returns:**
- `text` *(string)*:
### on_remove
---
```lua
rich_text:on_remove()
```
- `text` *(string)*: The current text of the rich text
### clear
@@ -129,25 +103,10 @@ rich_text:tagged(tag)
Get all words, which has a passed tag.
- **Parameters:**
- `tag` *(string)*:
- `tag` *(string)*: The tag to get the words for
- **Returns:**
- `words` *(druid.rich_text.word[])*:
### characters
---
```lua
rich_text:characters(word)
```
Split a word into it's characters
- **Parameters:**
- `word` *(druid.rich_text.word)*:
- **Returns:**
- `characters` *(druid.rich_text.word[])*:
- `words` *(druid.rich_text.word[])*: The words with the passed tag
### get_words
@@ -156,7 +115,7 @@ Split a word into it's characters
rich_text:get_words()
```
Get all current words.
Get all current created words, each word is a table that contains the information about the word
- **Returns:**
- `` *(druid.rich_text.word[])*:
@@ -168,19 +127,18 @@ Get all current words.
rich_text:get_line_metric()
```
Get current line metrics
-@return druid.rich_text.lines_metrics
Get the current line metrics
- **Returns:**
- `` *(druid.rich_text.lines_metrics)*:
- `lines_metrics` *(druid.rich_text.lines_metrics)*: The line metrics of the rich text
## Fields
<a name="root"></a>
- **root** (_node_)
- **root** (_node_): The root node of the rich text
<a name="text_prefab"></a>
- **text_prefab** (_node_)
- **text_prefab** (_node_): The text prefab node
<a name="style"></a>
- **style** (_table_)