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

@@ -1,6 +1,36 @@
# Back Handler Quick API reference
# druid.back_handler API
> at /druid/base/back_handler.lua
The component that handles the back handler action, like backspace or android back button
## Functions
- [init](#init)
## Fields
- [on_back](#on_back)
- [params](#params)
### init
---
```lua
back_handler:init([callback], [params])
back_handler:on_input([action_id], [action])
```
- **Parameters:**
- `[callback]` *(function|nil)*: The callback to call when the back handler is triggered
- `[params]` *(any)*: Custom args to pass in the callback
## Fields
<a name="on_back"></a>
- **on_back** (_event_): Trigger on back handler action, fun(self, params)
<a name="params"></a>
- **params** (_any_): Custom args to pass in the callback

View File

@@ -5,7 +5,6 @@
## Functions
- [init](#init)
- [on_input](#on_input)
- [set_enabled](#set_enabled)
- [is_enabled](#is_enabled)
@@ -23,21 +22,7 @@ blocker:init(node)
```
- **Parameters:**
- `node` *(node)*:
### on_input
---
```lua
blocker:on_input(action_id, action)
```
- **Parameters:**
- `action_id` *(string)*:
- `action` *(table)*:
- **Returns:**
- `` *(boolean)*:
- `node` *(string|node)*: The node to use as a blocker
### set_enabled
@@ -49,10 +34,10 @@ blocker:set_enabled(state)
Set blocker enabled state
- **Parameters:**
- `state` *(boolean)*:
- `state` *(boolean)*: The new enabled state
- **Returns:**
- `self` *(druid.blocker)*:
- `self` *(druid.blocker)*: The blocker instance
### is_enabled
@@ -64,7 +49,7 @@ blocker:is_enabled()
Get blocker enabled state
- **Returns:**
- `` *(boolean)*:
- `is_enabled` *(boolean)*: True if the blocker is enabled
## Fields

View File

@@ -7,10 +7,7 @@ Druid component to make clickable node with various interaction callbacks
## Functions
- [init](#init)
- [on_style_change](#on_style_change)
- [on_late_init](#on_late_init)
- [on_input](#on_input)
- [on_input_interrupt](#on_input_interrupt)
- [set_animations_disabled](#set_animations_disabled)
- [set_enabled](#set_enabled)
- [is_enabled](#is_enabled)
- [set_click_zone](#set_click_zone)
@@ -55,50 +52,25 @@ Druid component to make clickable node with various interaction callbacks
button:init(node_or_node_id, [callback], [custom_args], [anim_node])
```
The constructor for the button component
- **Parameters:**
- `node_or_node_id` *(string|node)*: Node name or GUI Node itself
- `[callback]` *(fun()|nil)*: Callback on button click
- `[custom_args]` *(any)*: Custom args for any Button event
- `[anim_node]` *(string|node|nil)*: Node to animate instead of trigger node
### on_style_change
### set_animations_disabled
---
```lua
button:on_style_change(style)
button:set_animations_disabled()
```
- **Parameters:**
- `style` *(druid.button.style)*: Button style params.
You can override this component styles params in Druid styles table or create your own style
### on_late_init
---
```lua
button:on_late_init()
```
### on_input
---
```lua
button:on_input(action_id, action)
```
- **Parameters:**
- `action_id` *(hash)*:
- `action` *(table)*:
Remove default button style animations
- **Returns:**
- `` *(boolean)*:
### on_input_interrupt
---
```lua
button:on_input_interrupt()
```
- `self` *(druid.button)*: The current button instance
### set_enabled
@@ -115,7 +87,7 @@ Disabled button is not clickable.
- `[state]` *(boolean|nil)*: Enabled state
- **Returns:**
- `self` *(druid.button)*:
- `self` *(druid.button)*: The current button instance
### is_enabled
@@ -145,7 +117,7 @@ If button node placed inside stencil node, it will be automatically set to this
- `[zone]` *(string|node|nil)*: Gui node
- **Returns:**
- `self` *(druid.button)*:
- `self` *(druid.button)*: The current button instance
### set_key_trigger
@@ -160,7 +132,7 @@ Set key name to trigger this button by keyboard.
- `key` *(string|hash)*: The action_id of the input key. Example: "key_space"
- **Returns:**
- `self` *(druid.button)*:
- `self` *(druid.button)*: The current button instance
### get_key_trigger
@@ -188,7 +160,7 @@ Set function for additional check for button click availability
- `[failure_callback]` *(function|nil)*: Function will be called on button click, if check function return false
- **Returns:**
- `self` *(druid.button)*:
- `self` *(druid.button)*: The current button instance
### set_web_user_interaction
@@ -206,7 +178,7 @@ If the game is not HTML, html mode will be not enabled
- `[is_web_mode]` *(boolean|nil)*: If true - button will be called inside html5 callback
- **Returns:**
- `self` *(druid.button)*:
- `self` *(druid.button)*: The current button instance
## Fields
@@ -265,7 +237,7 @@ If the game is not HTML, html mode will be not enabled
- **style** (_table_): Style for this button
<a name="druid"></a>
- **druid** (_druid.instance_)
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="is_repeated_started"></a>
- **is_repeated_started** (_boolean_)

View File

@@ -2,15 +2,12 @@
> at /druid/base/drag.lua
A component that allows you to subscribe to drag events over a node
## Functions
- [init](#init)
- [on_style_change](#on_style_change)
- [set_drag_cursors](#set_drag_cursors)
- [on_late_init](#on_late_init)
- [on_window_resized](#on_window_resized)
- [on_input_interrupt](#on_input_interrupt)
- [on_input](#on_input)
- [set_click_zone](#set_click_zone)
- [set_enabled](#set_enabled)
- [is_enabled](#is_enabled)
@@ -46,22 +43,14 @@
---
```lua
drag:init(node_or_node_id, on_drag_callback)
drag:init(node_or_node_id, [on_drag_callback])
```
- **Parameters:**
- `node_or_node_id` *(string|node)*:
- `on_drag_callback` *(function)*:
### on_style_change
---
```lua
drag:on_style_change(style)
```
The constructor for Drag component
- **Parameters:**
- `style` *(druid.drag.style)*:
- `node_or_node_id` *(string|node)*: The node to subscribe to drag events over
- `[on_drag_callback]` *(fun(self: any, touch: any))*: The callback to call when a drag occurs
### set_drag_cursors
@@ -73,42 +62,7 @@ drag:set_drag_cursors(is_enabled)
Set Drag component enabled state.
- **Parameters:**
- `is_enabled` *(boolean)*:
### on_late_init
---
```lua
drag:on_late_init()
```
### on_window_resized
---
```lua
drag:on_window_resized()
```
### on_input_interrupt
---
```lua
drag:on_input_interrupt()
```
### on_input
---
```lua
drag:on_input(action_id, action)
```
- **Parameters:**
- `action_id` *(hash)*:
- `action` *(table)*:
- **Returns:**
- `` *(boolean)*:
- `is_enabled` *(boolean)*: True if Drag component is enabled
### set_click_zone
@@ -120,7 +74,7 @@ drag:set_click_zone([node])
Set Drag click zone
- **Parameters:**
- `[node]` *(string|node|nil)*:
- `[node]` *(string|node|nil)*: Node or node id
- **Returns:**
- `self` *(druid.drag)*: Current instance
@@ -150,73 +104,73 @@ drag:is_enabled()
Check if Drag component is capture input
- **Returns:**
- `` *(boolean)*:
- `is_enabled` *(boolean)*: True if Drag component is enabled
## Fields
<a name="node"></a>
- **node** (_node_)
- **node** (_node_): The node to subscribe to drag events over
<a name="on_touch_start"></a>
- **on_touch_start** (_event_)
- **on_touch_start** (_event_): fun(self, touch) The event triggered when a touch starts
<a name="on_touch_end"></a>
- **on_touch_end** (_event_)
- **on_touch_end** (_event_): fun(self, touch) The event triggered when a touch ends
<a name="on_drag_start"></a>
- **on_drag_start** (_event_)
- **on_drag_start** (_event_): fun(self, touch) The event triggered when a drag starts
<a name="on_drag"></a>
- **on_drag** (_event_)
- **on_drag** (_event_): fun(self, touch) The event triggered when a drag occurs
<a name="on_drag_end"></a>
- **on_drag_end** (_event_)
- **on_drag_end** (_event_): fun(self, touch) The event triggered when a drag ends
<a name="style"></a>
- **style** (_druid.drag.style_)
- **style** (_druid.drag.style_): The style of Drag component
<a name="click_zone"></a>
- **click_zone** (_node_)
- **click_zone** (_node_): The click zone of Drag component
<a name="is_touch"></a>
- **is_touch** (_boolean_)
- **is_touch** (_boolean_): True if a touch is active
<a name="is_drag"></a>
- **is_drag** (_boolean_)
- **is_drag** (_boolean_): True if a drag is active
<a name="can_x"></a>
- **can_x** (_boolean_)
- **can_x** (_boolean_): True if Drag can move horizontally
<a name="can_y"></a>
- **can_y** (_boolean_)
- **can_y** (_boolean_): True if Drag can move vertically
<a name="dx"></a>
- **dx** (_number_)
- **dx** (_number_): The horizontal drag distance
<a name="dy"></a>
- **dy** (_number_)
- **dy** (_number_): The vertical drag distance
<a name="touch_id"></a>
- **touch_id** (_number_)
- **touch_id** (_number_): The touch id
<a name="x"></a>
- **x** (_number_)
- **x** (_number_): The current x position
<a name="y"></a>
- **y** (_number_)
- **y** (_number_): The current y position
<a name="screen_x"></a>
- **screen_x** (_number_)
- **screen_x** (_number_): The current screen x position
<a name="screen_y"></a>
- **screen_y** (_number_)
- **screen_y** (_number_): The current screen y position
<a name="touch_start_pos"></a>
- **touch_start_pos** (_vector3_)
- **touch_start_pos** (_vector3_): The touch start position
<a name="druid"></a>
- **druid** (_druid.instance_)
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="hover"></a>
- **hover** (_druid.hover_)
- **hover** (_druid.hover_): The component for handling hover events on a node

View File

@@ -2,13 +2,11 @@
> at /druid/base/hover.lua
The component for handling hover events on a node
## Functions
- [init](#init)
- [on_late_init](#on_late_init)
- [on_style_change](#on_style_change)
- [on_input](#on_input)
- [on_input_interrupt](#on_input_interrupt)
- [set_hover](#set_hover)
- [is_hovered](#is_hovered)
- [set_mouse_hover](#set_mouse_hover)
@@ -34,49 +32,13 @@
hover:init(node, on_hover_callback, on_mouse_hover)
```
The constructor for the hover component
- **Parameters:**
- `node` *(node)*: Gui node
- `on_hover_callback` *(function)*: Hover callback
- `on_mouse_hover` *(function)*: On mouse hover callback
### on_late_init
---
```lua
hover:on_late_init()
```
### on_style_change
---
```lua
hover:on_style_change(style)
```
- **Parameters:**
- `style` *(druid.hover.style)*:
### on_input
---
```lua
hover:on_input(action_id, action)
```
- **Parameters:**
- `action_id` *(hash)*:
- `action` *(table)*:
- **Returns:**
- `` *(boolean)*:
### on_input_interrupt
---
```lua
hover:on_input_interrupt()
```
### set_hover
---
@@ -166,17 +128,17 @@ Return current hover enabled state
## Fields
<a name="node"></a>
- **node** (_node_)
- **node** (_node_): Gui node
<a name="on_hover"></a>
- **on_hover** (_event_)
- **on_hover** (_event_): fun(self: druid.hover, is_hover: boolean) Hover event
<a name="on_mouse_hover"></a>
- **on_mouse_hover** (_event_)
- **on_mouse_hover** (_event_): fun(self: druid.hover, is_hover: boolean) Mouse hover event
<a name="style"></a>
- **style** (_druid.hover.style_)
- **style** (_druid.hover.style_): Style of the hover component
<a name="click_zone"></a>
- **click_zone** (_node_)
- **click_zone** (_node_): Click zone of the hover component

View File

@@ -5,12 +5,6 @@
## Functions
- [init](#init)
- [on_style_change](#on_style_change)
- [on_late_init](#on_late_init)
- [on_layout_change](#on_layout_change)
- [update](#update)
- [on_input](#on_input)
- [on_remove](#on_remove)
- [scroll_to](#scroll_to)
- [scroll_to_index](#scroll_to_index)
- [scroll_to_percent](#scroll_to_percent)
@@ -69,61 +63,6 @@ The Scroll constructor
- `view_node` *(string|node)*: GUI view scroll node
- `content_node` *(string|node)*: GUI content scroll node
### on_style_change
---
```lua
scroll:on_style_change(style)
```
- **Parameters:**
- `style` *(druid.scroll.style)*: Scroll style parameters
### on_late_init
---
```lua
scroll:on_late_init()
```
### on_layout_change
---
```lua
scroll:on_layout_change()
```
### update
---
```lua
scroll:update([dt])
```
- **Parameters:**
- `[dt]` *(any)*:
### on_input
---
```lua
scroll:on_input([action_id], [action])
```
- **Parameters:**
- `[action_id]` *(any)*:
- `[action]` *(any)*:
- **Returns:**
- `` *(boolean)*:
### on_remove
---
```lua
scroll:on_remove()
```
### scroll_to
---
@@ -191,7 +130,7 @@ Set scroll content size.
- `[offset]` *(vector3|nil)*: Offset value to set, where content is starts
- **Returns:**
- `Current` *(druid.scroll)*: scroll instance
- `self` *(druid.scroll)*: Current scroll instance
### set_view_size
@@ -206,7 +145,7 @@ Set new scroll view size in case the node size was changed.
- `size` *(vector3)*: The new size for view node
- **Returns:**
- `Current` *(druid.scroll)*: scroll instance
- `self` *(druid.scroll)*: Current scroll instance
### update_view_size
@@ -215,10 +154,10 @@ Set new scroll view size in case the node size was changed.
scroll:update_view_size()
```
Refresh scroll view size
Refresh scroll view size, used when view node size is changed
- **Returns:**
- `` *(druid.scroll)*:
- `self` *(druid.scroll)*: Current scroll instance
### set_inert
@@ -235,7 +174,7 @@ Enable or disable scroll inert
- `state` *(boolean)*: Inert scroll state
- **Returns:**
- `Current` *(druid.scroll)*: scroll instance
- `self` *(druid.scroll)*: Current scroll instance
### is_inert
@@ -263,7 +202,7 @@ Set extra size for scroll stretching
- `[stretch_size]` *(number|nil)*: Size in pixels of additional scroll area
- **Returns:**
- `Current` *(druid.scroll)*: scroll instance
- `self` *(druid.scroll)*: Current scroll instance
### get_scroll_size
@@ -291,7 +230,7 @@ Set points of interest.
- `points` *(table)*: Array of vector3 points
- **Returns:**
- `Current` *(druid.scroll)*: scroll instance
- `self` *(druid.scroll)*: Current scroll instance
### set_horizontal_scroll
@@ -306,7 +245,7 @@ Lock or unlock horizontal scroll
- `state` *(boolean)*: True, if horizontal scroll is enabled
- **Returns:**
- `Current` *(druid.scroll)*: scroll instance
- `self` *(druid.scroll)*: Current scroll instance
### set_vertical_scroll
@@ -321,7 +260,7 @@ Lock or unlock vertical scroll
- `state` *(boolean)*: True, if vertical scroll is enabled
- **Returns:**
- `Current` *(druid.scroll)*: scroll instance
- `self` *(druid.scroll)*: Current scroll instance
### is_node_in_view
@@ -353,7 +292,7 @@ Bind the grid component (Static or Dynamic) to recalculate
- `[grid]` *(druid.grid|nil)*: Druid grid component
- **Returns:**
- `Current` *(druid.scroll)*: scroll instance
- `self` *(druid.scroll)*: Current scroll instance
### set_click_zone
@@ -422,10 +361,10 @@ Strict drag scroll area. Useful for
- **style** (_druid.scroll.style_): Component style parameters
<a name="druid"></a>
- **druid** (_druid.instance_)
- **druid** (_druid.instance_): The Druid Factory used to create components
<a name="hover"></a>
- **hover** (_druid.hover_)
- **hover** (_druid.hover_): The component for handling hover events on a node
<a name="points"></a>
- **points** (_table_)

View File

@@ -2,14 +2,14 @@
> at /druid/base/static_grid.lua
The component for manage the nodes position in the grid with various options
## Functions
- [init](#init)
- [on_style_change](#on_style_change)
- [get_pos](#get_pos)
- [get_index](#get_index)
- [get_index_by_node](#get_index_by_node)
- [on_layout_change](#on_layout_change)
- [set_anchor](#set_anchor)
- [refresh](#refresh)
- [set_pivot](#set_pivot)
@@ -55,21 +55,13 @@
grid:init(parent, element, [in_row])
```
The constructor for the grid component
- **Parameters:**
- `parent` *(string|node)*: The GUI Node container, where grid's items will be placed
- `element` *(node)*: Element prefab. Need to get it size
- `[in_row]` *(number|nil)*: How many nodes in row can be placed. By default 1
### on_style_change
---
```lua
grid:on_style_change(style)
```
- **Parameters:**
- `style` *(druid.grid.style)*:
### get_pos
---
@@ -92,13 +84,13 @@ Return pos for grid node index
grid:get_index(pos)
```
Return index for grid pos
Return grid index by position
- **Parameters:**
- `pos` *(vector3)*: The node position in the grid
- **Returns:**
- `The` *(number)*: node index
- `index` *(number)*: The node index
### get_index_by_node
@@ -115,13 +107,6 @@ Return grid index by node
- **Returns:**
- `index` *(number|nil)*: The node index
### on_layout_change
---
```lua
grid:on_layout_change()
```
### set_anchor
---
@@ -141,17 +126,25 @@ Set grid anchor. Default anchor is equal to anchor of grid parent node
grid:refresh()
```
Update grid content
Instantly update the grid content
- **Returns:**
- `self` *(druid.grid)*: Current grid instance
### set_pivot
---
```lua
grid:set_pivot([pivot])
grid:set_pivot(pivot)
```
Set grid pivot
- **Parameters:**
- `[pivot]` *(any)*:
- `pivot` *(constant)*: The new pivot
- **Returns:**
- `self` *(druid.grid)*: Current grid instance
### add
@@ -168,6 +161,9 @@ Add new item to the grid
- `[shift_policy]` *(number|nil)*: How shift nodes, if required. Default: const.SHIFT.RIGHT
- `[is_instant]` *(boolean|nil)*: If true, update node positions instantly
- **Returns:**
- `self` *(druid.grid)*: Current grid instance
### set_items
---
@@ -181,6 +177,9 @@ Set new items to the grid. All previous items will be removed
- `nodes` *(node[])*: The new grid nodes
- `[is_instant]` *(boolean|nil)*: If true, update node positions instantly
- **Returns:**
- `self` *(druid.grid)*: Current grid instance
### remove
---
@@ -196,7 +195,7 @@ Remove the item from the grid. Note that gui node will be not deleted
- `[is_instant]` *(boolean|nil)*: If true, update node positions instantly
- **Returns:**
- `The` *(node)*: deleted gui node from grid
- `node` *(node)*: The deleted gui node from grid
### get_size
@@ -208,17 +207,22 @@ grid:get_size()
Return grid content size
- **Returns:**
- `The` *(vector3)*: grid content size
- `size` *(vector3)*: The grid content size
### get_size_for
---
```lua
grid:get_size_for([count])
grid:get_size_for(count)
```
Return grid content size for given count of nodes
- **Parameters:**
- `[count]` *(any)*:
- `count` *(number)*: The count of nodes
- **Returns:**
- `size` *(vector3)*: The grid content size
### get_borders
@@ -230,7 +234,7 @@ grid:get_borders()
Return grid content borders
- **Returns:**
- `The` *(vector4)*: grid content borders
- `borders` *(vector4)*: The grid content borders
### get_all_pos
@@ -242,7 +246,7 @@ grid:get_all_pos()
Return array of all node positions
- **Returns:**
- `All` *(vector3[])*: grid node positions
- `positions` *(vector3[])*: All grid node positions
### set_position_function
@@ -258,7 +262,7 @@ Change set position function for grid nodes. It will call on
- `callback` *(function)*: Function on node set position
- **Returns:**
- `Current` *(druid.grid)*: grid instance
- `self` *(druid.grid)*: Current grid instance
### clear
@@ -271,7 +275,7 @@ Clear grid nodes array. GUI nodes will be not deleted!
If you want to delete GUI nodes, use static_grid.nodes array before grid:clear
- **Returns:**
- `Current` *(druid.grid)*: grid instance
- `self` *(druid.grid)*: Current grid instance
### get_offset
@@ -283,7 +287,7 @@ grid:get_offset()
Return StaticGrid offset, where StaticGrid content starts.
- **Returns:**
- `The` *(vector3)*: StaticGrid offset
- `offset` *(vector3)*: The StaticGrid offset
### set_in_row
@@ -298,7 +302,7 @@ Set new in_row elements for grid
- `in_row` *(number)*: The new in_row value
- **Returns:**
- `Current` *(druid.grid)*: grid instance
- `self` *(druid.grid)*: Current grid instance
### set_item_size
@@ -314,7 +318,7 @@ Set new node size for grid
- `[height]` *(number|nil)*: The new node height
- **Returns:**
- `Current` *(druid.grid)*: grid instance
- `self` *(druid.grid)*: Current grid instance
### sort_nodes
@@ -334,49 +338,49 @@ Sort grid nodes by custom comparator function
## Fields
<a name="on_add_item"></a>
- **on_add_item** (_event_)
- **on_add_item** (_event_): Trigger on add item event, fun(self, item, index)
<a name="on_remove_item"></a>
- **on_remove_item** (_event_)
- **on_remove_item** (_event_): Trigger on remove item event, fun(self, index)
<a name="on_change_items"></a>
- **on_change_items** (_event_)
- **on_change_items** (_event_): Trigger on change items event, fun(self, index)
<a name="on_clear"></a>
- **on_clear** (_event_)
- **on_clear** (_event_): Trigger on clear event, fun(self)
<a name="on_update_positions"></a>
- **on_update_positions** (_event_)
- **on_update_positions** (_event_): Trigger on update positions event, fun(self)
<a name="parent"></a>
- **parent** (_node_)
- **parent** (_node_): Parent node
<a name="nodes"></a>
- **nodes** (_node[]_)
- **nodes** (_node[]_): Nodes array
<a name="first_index"></a>
- **first_index** (_number_)
- **first_index** (_number_): First index
<a name="last_index"></a>
- **last_index** (_number_)
- **last_index** (_number_): Last index
<a name="anchor"></a>
- **anchor** (_vector3_)
- **anchor** (_vector3_): Anchor
<a name="pivot"></a>
- **pivot** (_vector3_)
- **pivot** (_vector3_): Pivot
<a name="node_size"></a>
- **node_size** (_vector3_)
- **node_size** (_vector3_): Node size
<a name="border"></a>
- **border** (_vector4_)
- **border** (_vector4_): Border
<a name="in_row"></a>
- **in_row** (_number_)
- **in_row** (_number_): In row
<a name="style"></a>
- **style** (_table_)
- **style** (_druid.grid.style_): Style
<a name="node_pivot"></a>
- **node_pivot** (_unknown_)

View File

@@ -2,11 +2,11 @@
> at /druid/base/text.lua
The component to handle text behaviour over a GUI Text node, mainly used to automatically adjust text size to fit the text area
## Functions
- [init](#init)
- [on_style_change](#on_style_change)
- [on_layout_change](#on_layout_change)
- [get_text_size](#get_text_size)
- [get_text_index_by_width](#get_text_index_by_width)
- [set_to](#set_to)
@@ -54,26 +54,6 @@ The Text constructor
- `[value]` *(string|nil)*: Initial text. Default value is node text from GUI scene. Default: nil
- `[adjust_type]` *(string|nil)*: Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference. Default: DOWNSCALE
- **Returns:**
- `` *(druid.text)*:
### on_style_change
---
```lua
text:on_style_change(style)
```
- **Parameters:**
- `style` *(druid.text.style)*:
### on_layout_change
---
```lua
text:on_layout_change()
```
### get_text_size
---
@@ -84,11 +64,11 @@ text:get_text_size([text])
Calculate text width with font with respect to trailing space
- **Parameters:**
- `[text]` *(string|nil)*:
- `[text]` *(string|nil)*: The text to calculate the size of, if nil - use current text
- **Returns:**
- `Width` *(number)*:
- `Height` *(number)*:
- `width` *(number)*: The text width
- `height` *(number)*: The text height
### get_text_index_by_width
@@ -100,10 +80,10 @@ text:get_text_index_by_width(width)
Get chars count by width
- **Parameters:**
- `width` *(number)*:
- `width` *(number)*: The width to get the chars count of
- **Returns:**
- `Chars` *(number)*: count
- `index` *(number)*: The chars count
### set_to
@@ -118,7 +98,7 @@ Set text to text field
- `set_to` *(string)*: Text for node
- **Returns:**
- `Current` *(druid.text)*: text instance
- `self` *(druid.text)*: Current text instance
### set_text
@@ -171,7 +151,7 @@ Set color
- `color` *(vector4)*: Color for node
- **Returns:**
- `Current` *(druid.text)*: text instance
- `self` *(druid.text)*: Current text instance
### set_alpha
@@ -186,7 +166,7 @@ Set alpha
- `alpha` *(number)*: Alpha for node
- **Returns:**
- `Current` *(druid.text)*: text instance
- `self` *(druid.text)*: Current text instance
### set_scale
@@ -201,7 +181,7 @@ Set scale
- `scale` *(vector3)*: Scale for node
- **Returns:**
- `Current` *(druid.text)*: text instance
- `self` *(druid.text)*: Current text instance
### set_pivot
@@ -216,7 +196,7 @@ Set text pivot. Text will re-anchor inside text area
- `pivot` *(userdata)*: The gui.PIVOT_* constant
- **Returns:**
- `Current` *(druid.text)*: text instance
- `self` *(druid.text)*: Current text instance
### is_multiline
@@ -261,7 +241,7 @@ Set minimal scale for DOWNSCALE_LIMITED or SCALE_THEN_SCROLL adjust types
- `minimal_scale` *(number)*: If pass nil - not use minimal scale
- **Returns:**
- `Current` *(druid.text)*: text instance
- `self` *(druid.text)*: Current text instance
### get_text_adjust