mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 18:12:19 +02:00
Update docs
This commit is contained in:
@@ -4,10 +4,9 @@
|
||||
|
||||
The component that handles a rich text input field, it's a wrapper around the druid.input component
|
||||
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [on_input](#on_input)
|
||||
- [set_placeholder](#set_placeholder)
|
||||
- [select](#select)
|
||||
- [set_text](#set_text)
|
||||
@@ -15,8 +14,8 @@ The component that handles a rich text input field, it's a wrapper around the dr
|
||||
- [get_text](#get_text)
|
||||
- [set_allowed_characters](#set_allowed_characters)
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
- [root](#root)
|
||||
- [input](#input)
|
||||
- [cursor](#cursor)
|
||||
@@ -43,20 +42,6 @@ rich_input:init(template, nodes)
|
||||
- `template` *(string)*: The template string name
|
||||
- `nodes` *(table)*: Nodes table from gui.clone_tree
|
||||
|
||||
### on_input
|
||||
|
||||
---
|
||||
```lua
|
||||
rich_input:on_input([action_id], [action])
|
||||
```
|
||||
|
||||
- **Parameters:**
|
||||
- `[action_id]` *(any)*:
|
||||
- `[action]` *(any)*:
|
||||
|
||||
- **Returns:**
|
||||
- `` *(boolean)*:
|
||||
|
||||
### set_placeholder
|
||||
|
||||
---
|
||||
@@ -176,7 +161,7 @@ Set allowed charaters for input field.
|
||||
- **drag** (_druid.drag_): A component that allows you to subscribe to drag events over a node
|
||||
|
||||
<a name="placeholder"></a>
|
||||
- **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
|
||||
- **placeholder** (_druid.text_): Basic Druid text component. Text components by default have the text size adjusting.
|
||||
|
||||
<a name="text_position"></a>
|
||||
- **text_position** (_unknown_)
|
||||
|
@@ -4,8 +4,8 @@
|
||||
|
||||
The component that handles a rich text display, allows to custom color, size, font, etc. of the parts of the text
|
||||
|
||||
|
||||
## Functions
|
||||
|
||||
- [init](#init)
|
||||
- [set_text](#set_text)
|
||||
- [get_text](#get_text)
|
||||
@@ -14,8 +14,8 @@ The component that handles a rich text display, allows to custom color, size, fo
|
||||
- [get_words](#get_words)
|
||||
- [get_line_metric](#get_line_metric)
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
- [root](#root)
|
||||
- [text_prefab](#text_prefab)
|
||||
- [style](#style)
|
||||
@@ -52,22 +52,30 @@ Set text for Rich Text
|
||||
- **Example Usage:**
|
||||
|
||||
```lua
|
||||
-- Color
|
||||
rich_text:set_text("<color=red>Foobar</color>")
|
||||
rich_text:set_text("<color=1.0,0,0,1.0>Foobar</color>")
|
||||
rich_text:set_text("<color=#ff0000>Foobar</color>")
|
||||
rich_text:set_text("<color=#ff0000ff>Foobar</color>")
|
||||
-- Shadow
|
||||
rich_text:set_text("<shadow=red>Foobar</shadow>")
|
||||
rich_text:set_text("<shadow=1.0,0,0,1.0>Foobar</shadow>")
|
||||
rich_text:set_text("<shadow=#ff0000>Foobar</shadow>")
|
||||
rich_text:set_text("<shadow=#ff0000ff>Foobar</shadow>")
|
||||
-- Outline
|
||||
rich_text:set_text("<outline=red>Foobar</outline>")
|
||||
rich_text:set_text("<outline=1.0,0,0,1.0>Foobar</outline>")
|
||||
rich_text:set_text("<outline=#ff0000>Foobar</outline>")
|
||||
rich_text:set_text("<outline=#ff0000ff>Foobar</outline>")
|
||||
-- Font
|
||||
rich_text:set_text("<font=MyCoolFont>Foobar</font>")
|
||||
-- Size
|
||||
rich_text:set_text("<size=2>Twice as large</size>")
|
||||
-- Line break
|
||||
rich_text:set_text("<br/>Insert a line break")
|
||||
-- No break
|
||||
rich_text:set_text("<nobr>Prevent the text from breaking")
|
||||
-- Image
|
||||
rich_text:set_text("<img=texture:image>Display image")
|
||||
rich_text:set_text("<img=texture:image,size>Display image with size")
|
||||
rich_text:set_text("<img=texture:image,width,height>Display image with width and height")
|
||||
|
Reference in New Issue
Block a user