Update annotations

This commit is contained in:
Insality 2024-08-27 17:45:09 +03:00
parent 5f2ae1eb0d
commit 11ae63a9f6
42 changed files with 275 additions and 356 deletions

View File

@ -1,56 +0,0 @@
std = "max"
files['.luacheckrc'].global = false
unused_args = false
max_code_line_length = 120
max_comment_line_length = false
globals = {
"sys",
"go",
"gui",
"label",
"render",
"crash",
"sprite",
"sound",
"tilemap",
"spine",
"particlefx",
"physics",
"factory",
"collectionfactory",
"iac",
"msg",
"vmath",
"url",
"http",
"image",
"json",
"zlib",
"iap",
"push",
"facebook",
"hash",
"hash_to_hex",
"pprint",
"init",
"final",
"update",
"on_input",
"on_message",
"on_reload",
"socket",
"table",
"debug",
"timer",
"window",
"buffer",
"resource",
"defos",
"html5",
"describe",
"before",
"after",
"it",
}

17
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
"Lua.diagnostics.globals": [
"init",
"final",
"update",
"on_message",
"on_input",
"describe",
"before",
"after",
"it"
],
"Lua.workspace.ignoreDir": [
".vscode",
"test/*"
]
}

View File

@ -360,7 +360,7 @@ local button = self.druid:new_button("button_name", on_button_click, c
<a href="../modules/Button.html#">Button</a> <a href="../modules/Button.html#">Button</a>
</li> </li>
<li><span class="parameter">zone</span> <li><span class="parameter">zone</span>
<span class="types"><a class="type" href="../modules/Button.html#node">node</a> or <span class="type">nil</span></span> <span class="types"><a class="type" href="../modules/Button.html#node">node</a>, <a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <span class="type">nil</span></span>
Gui node Gui node
</li> </li>
</ul> </ul>
@ -508,19 +508,16 @@ button:set_enabled(<span class="keyword">true</span>)</pre>
<h3>Fields:</h3> <h3>Fields:</h3>
<ul> <ul>
<li><span class="parameter">LONGTAP_TIME</span> <li><span class="parameter">LONGTAP_TIME</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
Minimum time to trigger on_hold_callback Minimum time to trigger on_hold_callback. Default: 0.4
(<em>default</em> 0.4)
</li> </li>
<li><span class="parameter">AUTOHOLD_TRIGGER</span> <li><span class="parameter">AUTOHOLD_TRIGGER</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
Maximum hold time to trigger button release while holding Maximum hold time to trigger button release while holding. Default: 0.8
(<em>default</em> 0.8)
</li> </li>
<li><span class="parameter">DOUBLETAP_TIME</span> <li><span class="parameter">DOUBLETAP_TIME</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
Time between double taps Time between double taps. Default: 0.4
(<em>default</em> 0.4)
</li> </li>
<li><span class="parameter">on_click</span> <li><span class="parameter">on_click</span>
<span class="types"><span class="type">function</span></span> <span class="types"><span class="type">function</span></span>
@ -565,9 +562,8 @@ button:set_enabled(<span class="keyword">true</span>)</pre>
<ul> <ul>
<li><span class="parameter">anim_node</span> <li><span class="parameter">anim_node</span>
<span class="types"><a class="type" href="../modules/Button.html#node">node</a></span> <span class="types"><a class="type" href="../modules/Button.html#node">node</a> or <span class="type">nil</span></span>
Default node
(<em>default</em> node)
</li> </li>
</ul> </ul>

View File

@ -87,7 +87,7 @@
<td class="summary">Return checkbox state</td> <td class="summary">Return checkbox state</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#init">init(self, node, callback[, click_node=node[, initial_state=false]])</a></td> <td class="name" nowrap><a href="#init">init(self, node, callback, click_node, initial_state)</a></td>
<td class="summary">The <a href="../modules/Checkbox.html#">Checkbox</a> constructor</td> <td class="summary">The <a href="../modules/Checkbox.html#">Checkbox</a> constructor</td>
</tr> </tr>
<tr> <tr>
@ -158,7 +158,7 @@
</dd> </dd>
<dt> <dt>
<a name = "init"></a> <a name = "init"></a>
<strong>init(self, node, callback[, click_node=node[, initial_state=false]])</strong> <strong>init(self, node, callback, click_node, initial_state)</strong>
</dt> </dt>
<dd> <dd>
The <a href="../modules/Checkbox.html#">Checkbox</a> constructor The <a href="../modules/Checkbox.html#">Checkbox</a> constructor
@ -179,14 +179,12 @@
Checkbox callback Checkbox callback
</li> </li>
<li><span class="parameter">click_node</span> <li><span class="parameter">click_node</span>
<span class="types"><a class="type" href="../modules/Checkbox.html#node">node</a></span> <span class="types"><a class="type" href="../modules/Checkbox.html#node">node</a> or <span class="type">nil</span></span>
Trigger node, by default equals to node Trigger node, by default equals to node. Default: node
(<em>default</em> node)
</li> </li>
<li><span class="parameter">initial_state</span> <li><span class="parameter">initial_state</span>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
The initial state of checkbox, default - false The initial state of checkbox, default - false
(<em>default</em> false)
</li> </li>
</ul> </ul>
@ -289,9 +287,8 @@
<ul> <ul>
<li><span class="parameter">click_node</span> <li><span class="parameter">click_node</span>
<span class="types"><a class="type" href="../modules/Checkbox.html#node">node</a></span> <span class="types"><a class="type" href="../modules/Checkbox.html#node">node</a> or <span class="type">nil</span></span>
(<em>default</em> node)
</li> </li>
</ul> </ul>

View File

@ -86,7 +86,7 @@
<td class="summary">Return checkbox group state</td> <td class="summary">Return checkbox group state</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#init">init(self, nodes, callback[, click_nodes=node])</a></td> <td class="name" nowrap><a href="#init">init(self, nodes, callback, click_nodes)</a></td>
<td class="summary">The <a href="../modules/CheckboxGroup.html#">CheckboxGroup</a> constructor</td> <td class="summary">The <a href="../modules/CheckboxGroup.html#">CheckboxGroup</a> constructor</td>
</tr> </tr>
<tr> <tr>
@ -142,7 +142,7 @@
</dd> </dd>
<dt> <dt>
<a name = "init"></a> <a name = "init"></a>
<strong>init(self, nodes, callback[, click_nodes=node])</strong> <strong>init(self, nodes, callback, click_nodes)</strong>
</dt> </dt>
<dd> <dd>
The <a href="../modules/CheckboxGroup.html#">CheckboxGroup</a> constructor The <a href="../modules/CheckboxGroup.html#">CheckboxGroup</a> constructor
@ -163,9 +163,8 @@
Checkbox callback Checkbox callback
</li> </li>
<li><span class="parameter">click_nodes</span> <li><span class="parameter">click_nodes</span>
<span class="types"><span class="type">node[]</span></span> <span class="types"><span class="type">node[]</span> or <span class="type">nil</span></span>
Array of trigger nodes, by default equals to nodes Array of trigger nodes, by default equals to nodes
(<em>default</em> node)
</li> </li>
</ul> </ul>

View File

@ -253,7 +253,7 @@
<a href="../modules/Drag.html#">Drag</a> <a href="../modules/Drag.html#">Drag</a>
</li> </li>
<li><span class="parameter">node</span> <li><span class="parameter">node</span>
<span class="types"><a class="type" href="../modules/Drag.html#node">node</a></span> <span class="types"><a class="type" href="../modules/Drag.html#node">node</a>, <a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <span class="type">nil</span></span>
Gui node Gui node
</li> </li>
</ul> </ul>
@ -305,14 +305,12 @@
<h3>Fields:</h3> <h3>Fields:</h3>
<ul> <ul>
<li><span class="parameter">DRAG_DEADZONE</span> <li><span class="parameter">DRAG_DEADZONE</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
Distance in pixels to start dragging Distance in pixels to start dragging. Default: 10
(<em>default</em> 10)
</li> </li>
<li><span class="parameter">NO_USE_SCREEN_KOEF</span> <li><span class="parameter">NO_USE_SCREEN_KOEF</span>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
If screen aspect ratio affects on drag values If screen aspect ratio affects on drag values. Default: false
(<em>default</em> false)
</li> </li>
</ul> </ul>

View File

@ -162,7 +162,7 @@ end
<td class="summary">Create <a href="../modules/Checkbox.html#">Checkbox</a> component</td> <td class="summary">Create <a href="../modules/Checkbox.html#">Checkbox</a> component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_checkbox_group">new_checkbox_group(self, nodes, callback[, click_nodes=node])</a></td> <td class="name" nowrap><a href="#new_checkbox_group">new_checkbox_group(self, nodes, callback, click_nodes)</a></td>
<td class="summary">Create <a href="../modules/CheckboxGroup.html#">CheckboxGroup</a> component</td> <td class="summary">Create <a href="../modules/CheckboxGroup.html#">CheckboxGroup</a> component</td>
</tr> </tr>
<tr> <tr>
@ -194,7 +194,7 @@ end
<td class="summary">Create <a href="../modules/LangText.html#">LangText</a> component</td> <td class="summary">Create <a href="../modules/LangText.html#">LangText</a> component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_layout">new_layout(self, node, mode)</a></td> <td class="name" nowrap><a href="#new_layout">new_layout(self, node, mode, on_size_changed_callback)</a></td>
<td class="summary">Create <a href="../modules/Layout.html#">Layout</a> component</td> <td class="summary">Create <a href="../modules/Layout.html#">Layout</a> component</td>
</tr> </tr>
<tr> <tr>
@ -202,7 +202,7 @@ end
<td class="summary">Create <a href="../modules/Progress.html#">Progress</a> component</td> <td class="summary">Create <a href="../modules/Progress.html#">Progress</a> component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#new_radio_group">new_radio_group(self, nodes, callback[, click_nodes=node])</a></td> <td class="name" nowrap><a href="#new_radio_group">new_radio_group(self, nodes, callback, click_nodes)</a></td>
<td class="summary">Create <a href="../modules/RadioGroup.html#">RadioGroup</a> component</td> <td class="summary">Create <a href="../modules/RadioGroup.html#">RadioGroup</a> component</td>
</tr> </tr>
<tr> <tr>
@ -246,11 +246,11 @@ end
<td class="summary">Remove created component from Druid instance.</td> <td class="summary">Remove created component from Druid instance.</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#set_blacklist">set_blacklist(self[, blacklist_components=nil])</a></td> <td class="name" nowrap><a href="#set_blacklist">set_blacklist(self, blacklist_components)</a></td>
<td class="summary">Set blacklist components for input processing.</td> <td class="summary">Set blacklist components for input processing.</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#set_whitelist">set_whitelist(self[, whitelist_components=nil])</a></td> <td class="name" nowrap><a href="#set_whitelist">set_whitelist(self, whitelist_components)</a></td>
<td class="summary">Set whitelist components for input processing.</td> <td class="summary">Set whitelist components for input processing.</td>
</tr> </tr>
<tr> <tr>
@ -415,7 +415,7 @@ end
Button callback params Button callback params
</li> </li>
<li><span class="parameter">anim_node</span> <li><span class="parameter">anim_node</span>
<span class="types"><span class="type">node</span> or <span class="type">nil</span></span> <span class="types"><span class="type">node</span>, <a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <span class="type">nil</span></span>
Button anim node (node, if not provided) Button anim node (node, if not provided)
</li> </li>
</ul> </ul>
@ -476,7 +476,7 @@ end
</dd> </dd>
<dt> <dt>
<a name = "new_checkbox_group"></a> <a name = "new_checkbox_group"></a>
<strong>new_checkbox_group(self, nodes, callback[, click_nodes=node])</strong> <strong>new_checkbox_group(self, nodes, callback, click_nodes)</strong>
</dt> </dt>
<dd> <dd>
Create <a href="../modules/CheckboxGroup.html#">CheckboxGroup</a> component Create <a href="../modules/CheckboxGroup.html#">CheckboxGroup</a> component
@ -489,7 +489,7 @@ end
</li> </li>
<li><span class="parameter">nodes</span> <li><span class="parameter">nodes</span>
<span class="types"><span class="type">node[]</span></span> <span class="types"><span class="type">(node</span> or <a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string)[]</a></span>
Array of gui node Array of gui node
</li> </li>
<li><span class="parameter">callback</span> <li><span class="parameter">callback</span>
@ -497,9 +497,8 @@ end
Checkbox callback Checkbox callback
</li> </li>
<li><span class="parameter">click_nodes</span> <li><span class="parameter">click_nodes</span>
<span class="types"><span class="type">node[]</span></span> <span class="types"><span class="type">(node</span>, <a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string)[]</a> or <span class="type">nil</span></span>
Array of trigger nodes, by default equals to nodes Array of trigger nodes, by default equals to nodes
(<em>default</em> node)
</li> </li>
</ul> </ul>
@ -712,7 +711,7 @@ end
Button node to enabled input component Button node to enabled input component
</li> </li>
<li><span class="parameter">text_node</span> <li><span class="parameter">text_node</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <span class="type">node</span></span> <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a>, <span class="type">node</span> or <span class="type">druid.text</span></span>
Text node what will be changed on user input Text node what will be changed on user input
</li> </li>
<li><span class="parameter">keyboard_type</span> <li><span class="parameter">keyboard_type</span>
@ -773,7 +772,7 @@ end
</dd> </dd>
<dt> <dt>
<a name = "new_layout"></a> <a name = "new_layout"></a>
<strong>new_layout(self, node, mode)</strong> <strong>new_layout(self, node, mode, on_size_changed_callback)</strong>
</dt> </dt>
<dd> <dd>
Create <a href="../modules/Layout.html#">Layout</a> component Create <a href="../modules/Layout.html#">Layout</a> component
@ -793,6 +792,10 @@ end
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span> <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
The layout mode The layout mode
</li> </li>
<li><span class="parameter">on_size_changed_callback</span>
<span class="types"><span class="type">function</span> or <span class="type">nil</span></span>
The callback on window resize
</li>
</ul> </ul>
<h3>Returns:</h3> <h3>Returns:</h3>
@ -847,7 +850,7 @@ end
</dd> </dd>
<dt> <dt>
<a name = "new_radio_group"></a> <a name = "new_radio_group"></a>
<strong>new_radio_group(self, nodes, callback[, click_nodes=node])</strong> <strong>new_radio_group(self, nodes, callback, click_nodes)</strong>
</dt> </dt>
<dd> <dd>
Create <a href="../modules/RadioGroup.html#">RadioGroup</a> component Create <a href="../modules/RadioGroup.html#">RadioGroup</a> component
@ -860,7 +863,7 @@ end
</li> </li>
<li><span class="parameter">nodes</span> <li><span class="parameter">nodes</span>
<span class="types"><span class="type">node[]</span></span> <span class="types"><span class="type">(node</span> or <a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string)[]</a></span>
Array of gui node Array of gui node
</li> </li>
<li><span class="parameter">callback</span> <li><span class="parameter">callback</span>
@ -868,9 +871,8 @@ end
Radio callback Radio callback
</li> </li>
<li><span class="parameter">click_nodes</span> <li><span class="parameter">click_nodes</span>
<span class="types"><span class="type">node[]</span></span> <span class="types"><span class="type">(node</span>, <a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string)[]</a> or <span class="type">nil</span></span>
Array of trigger nodes, by default equals to nodes Array of trigger nodes, by default equals to nodes
(<em>default</em> node)
</li> </li>
</ul> </ul>
@ -1249,7 +1251,7 @@ end
</dd> </dd>
<dt> <dt>
<a name = "set_blacklist"></a> <a name = "set_blacklist"></a>
<strong>set_blacklist(self[, blacklist_components=nil])</strong> <strong>set_blacklist(self, blacklist_components)</strong>
</dt> </dt>
<dd> <dd>
Set blacklist components for input processing. Set blacklist components for input processing.
@ -1264,9 +1266,8 @@ end
<a href="../modules/DruidInstance.html#">DruidInstance</a> <a href="../modules/DruidInstance.html#">DruidInstance</a>
</li> </li>
<li><span class="parameter">blacklist_components</span> <li><span class="parameter">blacklist_components</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a> or <span class="type">BaseComponent</span></span> <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a>, <span class="type">BaseComponent</span> or <span class="type">nil</span></span>
The array of component to blacklist The array of component to blacklist
(<em>default</em> nil)
</li> </li>
</ul> </ul>
@ -1283,7 +1284,7 @@ end
</dd> </dd>
<dt> <dt>
<a name = "set_whitelist"></a> <a name = "set_whitelist"></a>
<strong>set_whitelist(self[, whitelist_components=nil])</strong> <strong>set_whitelist(self, whitelist_components)</strong>
</dt> </dt>
<dd> <dd>
Set whitelist components for input processing. Set whitelist components for input processing.
@ -1298,9 +1299,8 @@ end
</li> </li>
<li><span class="parameter">whitelist_components</span> <li><span class="parameter">whitelist_components</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a> or <span class="type">BaseComponent</span></span> <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a>, <span class="type">BaseComponent</span> or <span class="type">nil</span></span>
The array of component to whitelist The array of component to whitelist
(<em>default</em> nil)
</li> </li>
</ul> </ul>

View File

@ -420,7 +420,7 @@
<ol> <ol>
<span class="types"><span class="type">vector3</span></span> <span class="types"><span class="type">vector3</span></span>
Node position node position
</ol> </ol>

View File

@ -289,9 +289,8 @@
<ul> <ul>
<li><span class="parameter">click_node</span> <li><span class="parameter">click_node</span>
<span class="types"><a class="type" href="../modules/Hotkey.html#node">node</a></span> <span class="types"><a class="type" href="../modules/Hotkey.html#node">node</a> or <span class="type">nil</span></span>
(<em>default</em> node)
</li> </li>
</ul> </ul>

View File

@ -259,7 +259,7 @@
<a href="../modules/Hover.html#">Hover</a> <a href="../modules/Hover.html#">Hover</a>
</li> </li>
<li><span class="parameter">zone</span> <li><span class="parameter">zone</span>
<span class="types"><span class="type">node</span></span> <span class="types"><span class="type">node</span>, <a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <span class="type">nil</span></span>
Gui node Gui node
</li> </li>
</ul> </ul>

View File

@ -422,23 +422,19 @@
<ul> <ul>
<li><span class="parameter">IS_LONGTAP_ERASE</span> <li><span class="parameter">IS_LONGTAP_ERASE</span>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span></span>
Is long tap will erase current input data Is long tap will erase current input data. Default: false
(<em>default</em> false)
</li> </li>
<li><span class="parameter">MASK_DEFAULT_CHAR</span> <li><span class="parameter">MASK_DEFAULT_CHAR</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span> <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
Default character mask for password input Default character mask for password input. Default: *]
(<em>default</em> *)
</li> </li>
<li><span class="parameter">IS_UNSELECT_ON_RESELECT</span> <li><span class="parameter">IS_UNSELECT_ON_RESELECT</span>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span></span>
If true, call unselect on select selected input If true, call unselect on select selected input. Default: false
(<em>default</em> false)
</li> </li>
<li><span class="parameter">NO_CONSUME_INPUT_WHILE_SELECTED</span> <li><span class="parameter">NO_CONSUME_INPUT_WHILE_SELECTED</span>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span></span>
If true, will not consume input while input is selected. It's allow to interact with other components while input is selected (text input still captured) If true, will not consume input while input is selected. It's allow to interact with other components while input is selected (text input still captured). Default: false
(<em>default</em> false)
</li> </li>
<li><span class="parameter">on_select</span> <li><span class="parameter">on_select</span>
<span class="types"><span class="type">function</span></span> <span class="types"><span class="type">function</span></span>

View File

@ -93,7 +93,7 @@
<td class="summary">Format string with new text params on localized text</td> <td class="summary">Format string with new text params on localized text</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#init">init(self, node[, locale_id=node_text[, adjust_type=downscale]])</a></td> <td class="name" nowrap><a href="#init">init(self, node, locale_id, adjust_type)</a></td>
<td class="summary">The <a href="../modules/LangText.html#">LangText</a> constructor</td> <td class="summary">The <a href="../modules/LangText.html#">LangText</a> constructor</td>
</tr> </tr>
<tr> <tr>
@ -185,7 +185,7 @@
</dd> </dd>
<dt> <dt>
<a name = "init"></a> <a name = "init"></a>
<strong>init(self, node[, locale_id=node_text[, adjust_type=downscale]])</strong> <strong>init(self, node, locale_id, adjust_type)</strong>
</dt> </dt>
<dd> <dd>
The <a href="../modules/LangText.html#">LangText</a> constructor The <a href="../modules/LangText.html#">LangText</a> constructor
@ -202,14 +202,12 @@
The node_id or gui.get_node(node_id) The node_id or gui.get_node(node_id)
</li> </li>
<li><span class="parameter">locale_id</span> <li><span class="parameter">locale_id</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span> <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <span class="type">nil</span></span>
Default locale id or text from node as default Default locale id or text from node as default
(<em>default</em> node_text)
</li> </li>
<li><span class="parameter">adjust_type</span> <li><span class="parameter">adjust_type</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span> <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <span class="type">nil</span></span>
Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference
(<em>default</em> downscale)
</li> </li>
</ul> </ul>

View File

@ -91,7 +91,7 @@
<td class="summary">Set current and min/max angles for component</td> <td class="summary">Set current and min/max angles for component</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#set_friction">set_friction(self[, value=1])</a></td> <td class="name" nowrap><a href="#set_friction">set_friction(self, value)</a></td>
<td class="summary">Set current and min/max angles for component</td> <td class="summary">Set current and min/max angles for component</td>
</tr> </tr>
</table> </table>
@ -192,7 +192,7 @@
</dd> </dd>
<dt> <dt>
<a name = "set_friction"></a> <a name = "set_friction"></a>
<strong>set_friction(self[, value=1])</strong> <strong>set_friction(self, value)</strong>
</dt> </dt>
<dd> <dd>
Set current and min/max angles for component Set current and min/max angles for component
@ -205,9 +205,8 @@
<a href="../modules/PinKnob.html#">PinKnob</a> <a href="../modules/PinKnob.html#">PinKnob</a>
</li> </li>
<li><span class="parameter">value</span> <li><span class="parameter">value</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
The spin speed multiplier The spin speed multiplier. Default: 1
(<em>default</em> 1)
</li> </li>
</ul> </ul>

View File

@ -103,7 +103,7 @@
<td class="summary">Return current progress bar value</td> <td class="summary">Return current progress bar value</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#init">init(self, node, key[, init_value=1])</a></td> <td class="name" nowrap><a href="#init">init(self, node, key, init_value)</a></td>
<td class="summary">The <a href="../modules/Progress.html#">Progress</a> constructor</td> <td class="summary">The <a href="../modules/Progress.html#">Progress</a> constructor</td>
</tr> </tr>
<tr> <tr>
@ -234,7 +234,7 @@
</dd> </dd>
<dt> <dt>
<a name = "init"></a> <a name = "init"></a>
<strong>init(self, node, key[, init_value=1])</strong> <strong>init(self, node, key, init_value)</strong>
</dt> </dt>
<dd> <dd>
The <a href="../modules/Progress.html#">Progress</a> constructor The <a href="../modules/Progress.html#">Progress</a> constructor
@ -255,9 +255,8 @@
Progress bar direction: const.SIDE.X or const.SIDE.Y Progress bar direction: const.SIDE.X or const.SIDE.Y
</li> </li>
<li><span class="parameter">init_value</span> <li><span class="parameter">init_value</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
Initial value of progress bar Initial value of progress bar. Default: 1
(<em>default</em> 1)
</li> </li>
</ul> </ul>
@ -401,14 +400,12 @@
<h3>Fields:</h3> <h3>Fields:</h3>
<ul> <ul>
<li><span class="parameter">SPEED</span> <li><span class="parameter">SPEED</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
Progress bas fill rate. More -> faster Progress bas fill rate. More -> faster. Default: 5
(<em>default</em> 5)
</li> </li>
<li><span class="parameter">MIN_DELTA</span> <li><span class="parameter">MIN_DELTA</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
Minimum step to fill progress bar Minimum step to fill progress bar. Default: 0.005
(<em>default</em> 0.005)
</li> </li>
</ul> </ul>

View File

@ -86,7 +86,7 @@
<td class="summary">Return radio group state</td> <td class="summary">Return radio group state</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#init">init(self, nodes, callback[, click_nodes=node])</a></td> <td class="name" nowrap><a href="#init">init(self, nodes, callback, click_nodes)</a></td>
<td class="summary">The <a href="../modules/RadioGroup.html#">RadioGroup</a> constructor</td> <td class="summary">The <a href="../modules/RadioGroup.html#">RadioGroup</a> constructor</td>
</tr> </tr>
<tr> <tr>
@ -142,7 +142,7 @@
</dd> </dd>
<dt> <dt>
<a name = "init"></a> <a name = "init"></a>
<strong>init(self, nodes, callback[, click_nodes=node])</strong> <strong>init(self, nodes, callback, click_nodes)</strong>
</dt> </dt>
<dd> <dd>
The <a href="../modules/RadioGroup.html#">RadioGroup</a> constructor The <a href="../modules/RadioGroup.html#">RadioGroup</a> constructor
@ -163,9 +163,8 @@
Radio callback Radio callback
</li> </li>
<li><span class="parameter">click_nodes</span> <li><span class="parameter">click_nodes</span>
<span class="types"><span class="type">node[]</span></span> <span class="types"><span class="type">node[]</span> or <span class="type">nil</span></span>
Array of trigger nodes, by default equals to nodes Array of trigger nodes, by default equals to nodes. Default - nodes
(<em>default</em> node)
</li> </li>
</ul> </ul>

View File

@ -403,19 +403,16 @@ Words &lt;nobr&gt;inside tag&lt;/nobr&gt; won't <span class="keyword">break</spa
<h3>Fields:</h3> <h3>Fields:</h3>
<ul> <ul>
<li><span class="parameter">COLORS</span> <li><span class="parameter">COLORS</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span> <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a> or <span class="type">nil</span></span>
Rich Text color aliases Rich Text color aliases. Default: {}
(<em>default</em> {})
</li> </li>
<li><span class="parameter">ADJUST_STEPS</span> <li><span class="parameter">ADJUST_STEPS</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
Amount steps of attemps text adjust by height Amount steps of attemps text adjust by height. Default: 20
(<em>default</em> 20)
</li> </li>
<li><span class="parameter">ADJUST_SCALE_DELTA</span> <li><span class="parameter">ADJUST_SCALE_DELTA</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
Scale step on each height adjust step Scale step on each height adjust step. Default: 0.02
(<em>default</em> 0.02)
</li> </li>
</ul> </ul>

View File

@ -529,7 +529,7 @@
</li> </li>
<li><span class="parameter">node</span> <li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span> <span class="types"><span class="type">node</span> or <a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
Gui node Gui node
</li> </li>
</ul> </ul>
@ -687,7 +687,7 @@
The new size for content node The new size for content node
</li> </li>
<li><span class="parameter">offset</span> <li><span class="parameter">offset</span>
<span class="types"><span class="type">vector3</span></span> <span class="types"><span class="type">vector3</span> or <span class="type">nil</span></span>
Offset value to set, where content is starts Offset value to set, where content is starts
</li> </li>
</ul> </ul>
@ -751,64 +751,52 @@
<h3>Fields:</h3> <h3>Fields:</h3>
<ul> <ul>
<li><span class="parameter">FRICT</span> <li><span class="parameter">FRICT</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
Multiplier for free inertion Multiplier for free inertion. Default: 0
(<em>default</em> 0)
</li> </li>
<li><span class="parameter">FRICT_HOLD</span> <li><span class="parameter">FRICT_HOLD</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
Multiplier for inertion, while touching Multiplier for inertion, while touching. Default: 0
(<em>default</em> 0)
</li> </li>
<li><span class="parameter">INERT_THRESHOLD</span> <li><span class="parameter">INERT_THRESHOLD</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
Scroll speed to stop inertion Scroll speed to stop inertion. Default: 3
(<em>default</em> 3)
</li> </li>
<li><span class="parameter">INERT_SPEED</span> <li><span class="parameter">INERT_SPEED</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
Multiplier for inertion speed Multiplier for inertion speed. Default: 30
(<em>default</em> 30)
</li> </li>
<li><span class="parameter">POINTS_DEADZONE</span> <li><span class="parameter">POINTS_DEADZONE</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
Speed to check points of interests in no_inertion mode Speed to check points of interests in no_inertion mode. Default: 20
(<em>default</em> 20)
</li> </li>
<li><span class="parameter">BACK_SPEED</span> <li><span class="parameter">BACK_SPEED</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
Scroll back returning lerp speed Scroll back returning lerp speed. Default: 35
(<em>default</em> 0.35)
</li> </li>
<li><span class="parameter">ANIM_SPEED</span> <li><span class="parameter">ANIM_SPEED</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
Scroll gui.animation speed for scroll_to function Scroll gui.animation speed for scroll_to function. Default: 2
(<em>default</em> 0.2)
</li> </li>
<li><span class="parameter">EXTRA_STRETCH_SIZE</span> <li><span class="parameter">EXTRA_STRETCH_SIZE</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
extra size in pixels outside of scroll (stretch effect) extra size in pixels outside of scroll (stretch effect). Default: 0
(<em>default</em> 0)
</li> </li>
<li><span class="parameter">SMALL_CONTENT_SCROLL</span> <li><span class="parameter">SMALL_CONTENT_SCROLL</span>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
If true, content node with size less than view node size can be scrolled If true, content node with size less than view node size can be scrolled. Default: false
(<em>default</em> false)
</li> </li>
<li><span class="parameter">WHEEL_SCROLL_SPEED</span> <li><span class="parameter">WHEEL_SCROLL_SPEED</span>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
The scroll speed via mouse wheel scroll or touchpad. Set to 0 to disable wheel scrolling The scroll speed via mouse wheel scroll or touchpad. Set to 0 to disable wheel scrolling. Default: 0
(<em>default</em> 0)
</li> </li>
<li><span class="parameter">WHEEL_SCROLL_INVERTED</span> <li><span class="parameter">WHEEL_SCROLL_INVERTED</span>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
If true, invert direction for touchpad and mouse wheel scroll If true, invert direction for touchpad and mouse wheel scroll. Default: false
(<em>default</em> false)
</li> </li>
<li><span class="parameter">WHEEL_SCROLL_BY_INERTION</span> <li><span class="parameter">WHEEL_SCROLL_BY_INERTION</span>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
If true, wheel will add inertion to scroll. Direct set position otherwise. If true, wheel will add inertion to scroll. Direct set position otherwise.. Default: false
(<em>default</em> false)
</li> </li>
</ul> </ul>

View File

@ -225,7 +225,7 @@
<a href="../modules/Slider.html#">Slider</a> <a href="../modules/Slider.html#">Slider</a>
</li> </li>
<li><span class="parameter">input_node</span> <li><span class="parameter">input_node</span>
<span class="types"><a class="type" href="../modules/Slider.html#node">node</a></span> <span class="types"><a class="type" href="../modules/Slider.html#node">node</a>, <a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <span class="type">nil</span></span>
</li> </li>
</ul> </ul>

View File

@ -138,7 +138,7 @@
<td class="summary">Return grid content size</td> <td class="summary">Return grid content size</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#init">init(self, parent, element[, in_row=1])</a></td> <td class="name" nowrap><a href="#init">init(self, parent, element, in_row)</a></td>
<td class="summary">The <a href="../modules/StaticGrid.html#">StaticGrid</a> constructor</td> <td class="summary">The <a href="../modules/StaticGrid.html#">StaticGrid</a> constructor</td>
</tr> </tr>
<tr> <tr>
@ -496,7 +496,7 @@
</dd> </dd>
<dt> <dt>
<a name = "init"></a> <a name = "init"></a>
<strong>init(self, parent, element[, in_row=1])</strong> <strong>init(self, parent, element, in_row)</strong>
</dt> </dt>
<dd> <dd>
The <a href="../modules/StaticGrid.html#">StaticGrid</a> constructor The <a href="../modules/StaticGrid.html#">StaticGrid</a> constructor
@ -517,9 +517,8 @@
Element prefab. Need to get it size Element prefab. Need to get it size
</li> </li>
<li><span class="parameter">in_row</span> <li><span class="parameter">in_row</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
How many nodes in row can be placed How many nodes in row can be placed. By default 1
(<em>default</em> 1)
</li> </li>
</ul> </ul>
@ -672,14 +671,12 @@
<h3>Fields:</h3> <h3>Fields:</h3>
<ul> <ul>
<li><span class="parameter">IS_DYNAMIC_NODE_POSES</span> <li><span class="parameter">IS_DYNAMIC_NODE_POSES</span>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
If true, always center grid content as grid pivot sets If true, always center grid content as grid pivot sets. Default: false
(<em>default</em> false)
</li> </li>
<li><span class="parameter">IS_ALIGN_LAST_ROW</span> <li><span class="parameter">IS_ALIGN_LAST_ROW</span>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
If true, always align last row of the grid as grid pivot sets If true, always align last row of the grid as grid pivot sets. Default: false
(<em>default</em> false)
</li> </li>
</ul> </ul>

View File

@ -169,7 +169,7 @@
<a href="../modules/Swipe.html#">Swipe</a> <a href="../modules/Swipe.html#">Swipe</a>
</li> </li>
<li><span class="parameter">zone</span> <li><span class="parameter">zone</span>
<span class="types"><a class="type" href="../modules/Swipe.html#node">node</a></span> <span class="types"><a class="type" href="../modules/Swipe.html#node">node</a>, <a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <span class="type">nil</span></span>
Gui node Gui node
</li> </li>
</ul> </ul>
@ -196,19 +196,16 @@
<h3>Fields:</h3> <h3>Fields:</h3>
<ul> <ul>
<li><span class="parameter">SWIPE_TIME</span> <li><span class="parameter">SWIPE_TIME</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
Maximum time for swipe trigger Maximum time for swipe trigger. Default: 0.4
(<em>default</em> 0.4)
</li> </li>
<li><span class="parameter">SWIPE_THRESHOLD</span> <li><span class="parameter">SWIPE_THRESHOLD</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
Minimum distance for swipe trigger Minimum distance for swipe trigger. Default: 50
(<em>default</em> 50)
</li> </li>
<li><span class="parameter">SWIPE_TRIGGER_ON_MOVE</span> <li><span class="parameter">SWIPE_TRIGGER_ON_MOVE</span>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
If true, trigger on swipe moving, not only release action If true, trigger on swipe moving, not only release action. Default: false
(<em>default</em> false)
</li> </li>
</ul> </ul>

View File

@ -109,7 +109,7 @@
<td class="summary">Calculate text width with font with respect to trailing space</td> <td class="summary">Calculate text width with font with respect to trailing space</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#init">init(self, node, value[, adjust_type=downscale])</a></td> <td class="name" nowrap><a href="#init">init(self, node, value, adjust_type)</a></td>
<td class="summary">The <a href="../modules/Text.html#">Text</a> constructor</td> <td class="summary">The <a href="../modules/Text.html#">Text</a> constructor</td>
</tr> </tr>
<tr> <tr>
@ -284,7 +284,7 @@
</dd> </dd>
<dt> <dt>
<a name = "init"></a> <a name = "init"></a>
<strong>init(self, node, value[, adjust_type=downscale])</strong> <strong>init(self, node, value, adjust_type)</strong>
</dt> </dt>
<dd> <dd>
The <a href="../modules/Text.html#">Text</a> constructor The <a href="../modules/Text.html#">Text</a> constructor
@ -305,9 +305,8 @@
Initial text. Default value is node text from GUI scene. Initial text. Default value is node text from GUI scene.
</li> </li>
<li><span class="parameter">adjust_type</span> <li><span class="parameter">adjust_type</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span> <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <span class="type">nil</span></span>
Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference. Default: downscale
(<em>default</em> downscale)
</li> </li>
</ul> </ul>
@ -612,14 +611,12 @@
<h3>Fields:</h3> <h3>Fields:</h3>
<ul> <ul>
<li><span class="parameter">TRIM_POSTFIX</span> <li><span class="parameter">TRIM_POSTFIX</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span> <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <span class="type">nil</span></span>
The postfix for TRIM adjust type The postfix for TRIM adjust type. Default: ...
(<em>default</em> ...)
</li> </li>
<li><span class="parameter">DEFAULT_ADJUST</span> <li><span class="parameter">DEFAULT_ADJUST</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span> <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <span class="type">nil</span></span>
The default adjust type for any text component The default adjust type for any text component. Default: DOWNSCALE
(<em>default</em> DOWNSCALE)
</li> </li>
</ul> </ul>

View File

@ -168,7 +168,7 @@ function druid__blocker.set_enabled(self, state) end
---@class druid.button : druid.base_component ---@class druid.button : druid.base_component
---@field anim_node node Button animation node. ---@field anim_node node|nil Button animation node.
---@field click_zone node|nil Additional button click area, defined by another GUI node ---@field click_zone node|nil Additional button click area, defined by another GUI node
---@field hover druid.hover The @{Hover}: Button Hover component ---@field hover druid.hover The @{Hover}: Button Hover component
---@field node node Button trigger node ---@field node node Button trigger node
@ -213,7 +213,7 @@ function druid__button.set_check_function(self, check_function, failure_callback
--- Set additional button click area. --- Set additional button click area.
--- Useful to restrict click outside out stencil node or scrollable content. This functions calls automatically if you don't disable it in game.project: druid.no_stencil_check --- Useful to restrict click outside out stencil node or scrollable content. This functions calls automatically if you don't disable it in game.project: druid.no_stencil_check
---@param self druid.button @{Button} ---@param self druid.button @{Button}
---@param zone node|nil Gui node ---@param zone node|string|nil Gui node
---@return druid.button Current button instance ---@return druid.button Current button instance
function druid__button.set_click_zone(self, zone) end function druid__button.set_click_zone(self, zone) end
@ -239,9 +239,9 @@ function druid__button.set_web_user_interaction(self, is_web_mode) end
---@class druid.button.style ---@class druid.button.style
---@field AUTOHOLD_TRIGGER number Maximum hold time to trigger button release while holding ---@field AUTOHOLD_TRIGGER number|nil Maximum hold time to trigger button release while holding. Default: 0.8
---@field DOUBLETAP_TIME number Time between double taps ---@field DOUBLETAP_TIME number|nil Time between double taps. Default: 0.4
---@field LONGTAP_TIME number Minimum time to trigger on_hold_callback ---@field LONGTAP_TIME number|nil Minimum time to trigger on_hold_callback. Default: 0.4
---@field on_click function function(self, node) ---@field on_click function function(self, node)
---@field on_click_disabled function function(self, node) ---@field on_click_disabled function function(self, node)
---@field on_hover function function(self, node, hover_state) ---@field on_hover function function(self, node, hover_state)
@ -252,7 +252,7 @@ local druid__button__style = {}
---@class druid.checkbox : druid.base_component ---@class druid.checkbox : druid.base_component
---@field button druid.button Button component from click_node ---@field button druid.button Button component from click_node
---@field click_node node Button trigger node ---@field click_node node|nil Button trigger node
---@field node node Visual node ---@field node node Visual node
---@field on_change_state druid.event On change state callback(self, state) ---@field on_change_state druid.event On change state callback(self, state)
---@field style druid.checkbox.style Component style params. ---@field style druid.checkbox.style Component style params.
@ -267,8 +267,8 @@ function druid__checkbox.get_state(self) end
---@param self druid.checkbox @{Checkbox} ---@param self druid.checkbox @{Checkbox}
---@param node node Gui node ---@param node node Gui node
---@param callback function Checkbox callback ---@param callback function Checkbox callback
---@param click_node node Trigger node, by default equals to node ---@param click_node node|nil Trigger node, by default equals to node. Default: node
---@param initial_state boolean The initial state of checkbox, default - false ---@param initial_state boolean|nil The initial state of checkbox, default - false
function druid__checkbox.init(self, node, callback, click_node, initial_state) end function druid__checkbox.init(self, node, callback, click_node, initial_state) end
--- Set checkbox state --- Set checkbox state
@ -298,7 +298,7 @@ function druid__checkbox_group.get_state(self) end
---@param self druid.checkbox_group @{CheckboxGroup} ---@param self druid.checkbox_group @{CheckboxGroup}
---@param nodes node[] Array of gui node ---@param nodes node[] Array of gui node
---@param callback function Checkbox callback ---@param callback function Checkbox callback
---@param click_nodes node[] Array of trigger nodes, by default equals to nodes ---@param click_nodes node[]|nil Array of trigger nodes, by default equals to nodes
function druid__checkbox_group.init(self, nodes, callback, click_nodes) end function druid__checkbox_group.init(self, nodes, callback, click_nodes) end
--- Set checkbox group state --- Set checkbox group state
@ -412,7 +412,7 @@ function druid__drag.is_enabled(self) end
--- Strict drag click area. --- Strict drag click area.
--- Useful for restrict events outside stencil node --- Useful for restrict events outside stencil node
---@param self druid.drag @{Drag} ---@param self druid.drag @{Drag}
---@param node node Gui node ---@param node node|string|nil Gui node
function druid__drag.set_click_zone(self, node) end function druid__drag.set_click_zone(self, node) end
--- Set Drag input enabled or disabled --- Set Drag input enabled or disabled
@ -422,8 +422,8 @@ function druid__drag.set_enabled(self, is_enabled) end
---@class druid.drag.style ---@class druid.drag.style
---@field DRAG_DEADZONE number Distance in pixels to start dragging ---@field DRAG_DEADZONE number|nil Distance in pixels to start dragging. Default: 10
---@field NO_USE_SCREEN_KOEF boolean If screen aspect ratio affects on drag values ---@field NO_USE_SCREEN_KOEF boolean|nil If screen aspect ratio affects on drag values. Default: false
local druid__drag__style = {} local druid__drag__style = {}
@ -487,7 +487,7 @@ function druid__dynamic_grid.get_offset(self) end
---@param index number The grid element index ---@param index number The grid element index
---@param node node The node to be placed ---@param node node The node to be placed
---@param origin_index number|nil Index of nearby node ---@param origin_index number|nil Index of nearby node
---@return vector3 Node position ---@return vector3 node position
function druid__dynamic_grid.get_pos(self, index, node, origin_index) end function druid__dynamic_grid.get_pos(self, index, node, origin_index) end
--- Return grid content size --- Return grid content size
@ -555,7 +555,7 @@ function druid__event.unsubscribe(self, callback, context) end
---@class druid.hotkey : druid.base_component ---@class druid.hotkey : druid.base_component
---@field button druid.button Button component from click_node ---@field button druid.button Button component from click_node
---@field click_node node Button trigger node ---@field click_node node|nil Button trigger node
---@field node node Visual node ---@field node node Visual node
---@field on_change_state druid.event On change state callback(self, state) ---@field on_change_state druid.event On change state callback(self, state)
---@field style druid.hotkey.style Component style params. ---@field style druid.hotkey.style Component style params.
@ -618,7 +618,7 @@ function druid__hover.is_mouse_hovered(self) end
--- Strict hover click area. --- Strict hover click area.
--- Useful for no click events outside stencil node --- Useful for no click events outside stencil node
---@param self druid.hover @{Hover} ---@param self druid.hover @{Hover}
---@param zone node Gui node ---@param zone node|string|nil Gui node
function druid__hover.set_click_zone(self, zone) end function druid__hover.set_click_zone(self, zone) end
--- Set enable state of hover component. --- Set enable state of hover component.
@ -702,10 +702,10 @@ function druid__input.unselect(self) end
---@class druid.input.style ---@class druid.input.style
---@field IS_LONGTAP_ERASE boolean Is long tap will erase current input data ---@field IS_LONGTAP_ERASE boolean Is long tap will erase current input data. Default: false
---@field IS_UNSELECT_ON_RESELECT boolean If true, call unselect on select selected input ---@field IS_UNSELECT_ON_RESELECT boolean If true, call unselect on select selected input. Default: false
---@field MASK_DEFAULT_CHAR string Default character mask for password input ---@field MASK_DEFAULT_CHAR string Default character mask for password input. Default: *]
---@field NO_CONSUME_INPUT_WHILE_SELECTED boolean If true, will not consume input while input is selected. It's allow to interact with other components while input is selected (text input still captured) ---@field NO_CONSUME_INPUT_WHILE_SELECTED boolean If true, will not consume input while input is selected. It's allow to interact with other components while input is selected (text input still captured). Default: false
---@field button_style table Custom button style for input node ---@field button_style table Custom button style for input node
---@field on_input_wrong function (self, button_node) Callback on wrong user input ---@field on_input_wrong function (self, button_node) Callback on wrong user input
---@field on_select function (self, button_node) Callback on input field selecting ---@field on_select function (self, button_node) Callback on input field selecting
@ -734,8 +734,8 @@ function druid__lang_text.format(self, a, b, c, d, e, f, g) end
--- The @{LangText} constructor --- The @{LangText} constructor
---@param self druid.lang_text @{LangText} ---@param self druid.lang_text @{LangText}
---@param node string|node The node_id or gui.get_node(node_id) ---@param node string|node The node_id or gui.get_node(node_id)
---@param locale_id string Default locale id or text from node as default ---@param locale_id string|nil Default locale id or text from node as default
---@param adjust_type string Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference ---@param adjust_type string|nil Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference
function druid__lang_text.init(self, node, locale_id, adjust_type) end function druid__lang_text.init(self, node, locale_id, adjust_type) end
--- Setup raw text to lang_text component --- Setup raw text to lang_text component
@ -846,7 +846,7 @@ function druid__pin_knob.set_angle(self, cur_value, min, max) end
--- Set current and min/max angles for component --- Set current and min/max angles for component
---@param self druid.pin_knob @{PinKnob} ---@param self druid.pin_knob @{PinKnob}
---@param value number The spin speed multiplier ---@param value number|nil The spin speed multiplier. Default: 1
---@return druid.pin_knob @{PinKnob} ---@return druid.pin_knob @{PinKnob}
function druid__pin_knob.set_friction(self, value) end function druid__pin_knob.set_friction(self, value) end
@ -878,7 +878,7 @@ function druid__progress.get(self) end
---@param self druid.progress @{Progress} ---@param self druid.progress @{Progress}
---@param node string|node Node name or GUI Node itself. ---@param node string|node Node name or GUI Node itself.
---@param key string Progress bar direction: const.SIDE.X or const.SIDE.Y ---@param key string Progress bar direction: const.SIDE.X or const.SIDE.Y
---@param init_value number Initial value of progress bar ---@param init_value number|nil Initial value of progress bar. Default: 1
function druid__progress.init(self, node, key, init_value) end function druid__progress.init(self, node, key, init_value) end
--- Set progress bar max node size --- Set progress bar max node size
@ -906,8 +906,8 @@ function druid__progress.to(self, to, callback) end
---@class druid.progress.style ---@class druid.progress.style
---@field MIN_DELTA number Minimum step to fill progress bar ---@field MIN_DELTA number|nil Minimum step to fill progress bar. Default: 0.005
---@field SPEED number Progress bas fill rate. More -> faster ---@field SPEED number|nil Progress bas fill rate. More -> faster. Default: 5
local druid__progress__style = {} local druid__progress__style = {}
@ -925,7 +925,7 @@ function druid__radio_group.get_state(self) end
---@param self druid.radio_group @{RadioGroup} ---@param self druid.radio_group @{RadioGroup}
---@param nodes node[] Array of gui node ---@param nodes node[] Array of gui node
---@param callback function Radio callback ---@param callback function Radio callback
---@param click_nodes node[] Array of trigger nodes, by default equals to nodes ---@param click_nodes node[]|nil Array of trigger nodes, by default equals to nodes. Default - nodes
function druid__radio_group.init(self, nodes, callback, click_nodes) end function druid__radio_group.init(self, nodes, callback, click_nodes) end
--- Set radio group state --- Set radio group state
@ -1004,9 +1004,9 @@ function druid__rich_text.tagged(tag) end
---@class druid.rich_text.style ---@class druid.rich_text.style
---@field ADJUST_SCALE_DELTA number Scale step on each height adjust step ---@field ADJUST_SCALE_DELTA number|nil Scale step on each height adjust step. Default: 0.02
---@field ADJUST_STEPS number Amount steps of attemps text adjust by height ---@field ADJUST_STEPS number|nil Amount steps of attemps text adjust by height. Default: 20
---@field COLORS table Rich Text color aliases ---@field COLORS table|nil Rich Text color aliases. Default: {}
local druid__rich_text__style = {} local druid__rich_text__style = {}
@ -1084,7 +1084,7 @@ function druid__scroll.scroll_to_percent(self, percent, is_instant) end
--- Strict drag scroll area. --- Strict drag scroll area.
--- Useful for restrict events outside stencil node --- Useful for restrict events outside stencil node
---@param self druid.drag ---@param self druid.drag
---@param node node Gui node ---@param node node|string Gui node
function druid__scroll.set_click_zone(self, node) end function druid__scroll.set_click_zone(self, node) end
--- Set extra size for scroll stretching. --- Set extra size for scroll stretching.
@ -1118,7 +1118,7 @@ function druid__scroll.set_points(self, points) end
--- It will change content gui node size --- It will change content gui node size
---@param self druid.scroll @{Scroll} ---@param self druid.scroll @{Scroll}
---@param size vector3 The new size for content node ---@param size vector3 The new size for content node
---@param offset vector3 Offset value to set, where content is starts ---@param offset vector3|nil Offset value to set, where content is starts
---@return druid.scroll Current scroll instance ---@return druid.scroll Current scroll instance
function druid__scroll.set_size(self, size, offset) end function druid__scroll.set_size(self, size, offset) end
@ -1130,18 +1130,18 @@ function druid__scroll.set_vertical_scroll(self, state) end
---@class druid.scroll.style ---@class druid.scroll.style
---@field ANIM_SPEED number Scroll gui.animation speed for scroll_to function ---@field ANIM_SPEED number|nil Scroll gui.animation speed for scroll_to function. Default: 2
---@field BACK_SPEED number Scroll back returning lerp speed ---@field BACK_SPEED number|nil Scroll back returning lerp speed. Default: 35
---@field EXTRA_STRETCH_SIZE number extra size in pixels outside of scroll (stretch effect) ---@field EXTRA_STRETCH_SIZE number|nil extra size in pixels outside of scroll (stretch effect). Default: 0
---@field FRICT number Multiplier for free inertion ---@field FRICT number|nil Multiplier for free inertion. Default: 0
---@field FRICT_HOLD number Multiplier for inertion, while touching ---@field FRICT_HOLD number|nil Multiplier for inertion, while touching. Default: 0
---@field INERT_SPEED number Multiplier for inertion speed ---@field INERT_SPEED number|nil Multiplier for inertion speed. Default: 30
---@field INERT_THRESHOLD number Scroll speed to stop inertion ---@field INERT_THRESHOLD number|nil Scroll speed to stop inertion. Default: 3
---@field POINTS_DEADZONE number Speed to check points of interests in no_inertion mode ---@field POINTS_DEADZONE number|nil Speed to check points of interests in no_inertion mode. Default: 20
---@field SMALL_CONTENT_SCROLL boolean If true, content node with size less than view node size can be scrolled ---@field SMALL_CONTENT_SCROLL boolean|nil If true, content node with size less than view node size can be scrolled. Default: false
---@field WHEEL_SCROLL_BY_INERTION boolean If true, wheel will add inertion to scroll. Direct set position otherwise. ---@field WHEEL_SCROLL_BY_INERTION boolean|nil If true, wheel will add inertion to scroll. Direct set position otherwise.. Default: false
---@field WHEEL_SCROLL_INVERTED boolean If true, invert direction for touchpad and mouse wheel scroll ---@field WHEEL_SCROLL_INVERTED boolean|nil If true, invert direction for touchpad and mouse wheel scroll. Default: false
---@field WHEEL_SCROLL_SPEED boolean The scroll speed via mouse wheel scroll or touchpad. Set to 0 to disable wheel scrolling ---@field WHEEL_SCROLL_SPEED boolean|nil The scroll speed via mouse wheel scroll or touchpad. Set to 0 to disable wheel scrolling. Default: 0
local druid__scroll__style = {} local druid__scroll__style = {}
@ -1173,7 +1173,7 @@ function druid__slider.set(self, value, is_silent) end
--- Set input zone for slider. --- Set input zone for slider.
--- User can touch any place of node, pin instantly will move at this position and node drag will start. This function require the Defold version 1.3.0+ --- User can touch any place of node, pin instantly will move at this position and node drag will start. This function require the Defold version 1.3.0+
---@param self druid.slider @{Slider} ---@param self druid.slider @{Slider}
---@param input_node node ---@param input_node node|string|nil
---@return druid.slider @{Slider} ---@return druid.slider @{Slider}
function druid__slider.set_input_node(self, input_node) end function druid__slider.set_input_node(self, input_node) end
@ -1258,7 +1258,7 @@ function druid__static_grid.get_size(self) end
---@param self druid.static_grid @{StaticGrid} ---@param self druid.static_grid @{StaticGrid}
---@param parent string|node The GUI Node container, where grid's items will be placed ---@param parent string|node The GUI Node container, where grid's items will be placed
---@param element node Element prefab. Need to get it size ---@param element node Element prefab. Need to get it size
---@param in_row number How many nodes in row can be placed ---@param in_row number|nil How many nodes in row can be placed. By default 1
function druid__static_grid.init(self, parent, element, in_row) end function druid__static_grid.init(self, parent, element, in_row) end
--- Remove the item from the grid. --- Remove the item from the grid.
@ -1291,8 +1291,8 @@ function druid__static_grid.set_position_function(self, callback) end
---@class druid.static_grid.style ---@class druid.static_grid.style
---@field IS_ALIGN_LAST_ROW boolean If true, always align last row of the grid as grid pivot sets ---@field IS_ALIGN_LAST_ROW boolean|nil If true, always align last row of the grid as grid pivot sets. Default: false
---@field IS_DYNAMIC_NODE_POSES boolean If true, always center grid content as grid pivot sets ---@field IS_DYNAMIC_NODE_POSES boolean|nil If true, always center grid content as grid pivot sets. Default: false
local druid__static_grid__style = {} local druid__static_grid__style = {}
@ -1312,14 +1312,14 @@ function druid__swipe.init(self, node, on_swipe_callback) end
--- Strict swipe click area. --- Strict swipe click area.
--- Useful for restrict events outside stencil node --- Useful for restrict events outside stencil node
---@param self druid.swipe @{Swipe} ---@param self druid.swipe @{Swipe}
---@param zone node Gui node ---@param zone node|string|nil Gui node
function druid__swipe.set_click_zone(self, zone) end function druid__swipe.set_click_zone(self, zone) end
---@class druid.swipe.style ---@class druid.swipe.style
---@field SWIPE_THRESHOLD number Minimum distance for swipe trigger ---@field SWIPE_THRESHOLD number|nil Minimum distance for swipe trigger. Default: 50
---@field SWIPE_TIME number Maximum time for swipe trigger ---@field SWIPE_TIME number|nil Maximum time for swipe trigger. Default: 0.4
---@field SWIPE_TRIGGER_ON_MOVE boolean If true, trigger on swipe moving, not only release action ---@field SWIPE_TRIGGER_ON_MOVE boolean|nil If true, trigger on swipe moving, not only release action. Default: false
local druid__swipe__style = {} local druid__swipe__style = {}
@ -1357,7 +1357,7 @@ function druid__text.get_text_size(self, text) end
---@param self druid.text @{Text} ---@param self druid.text @{Text}
---@param node string|node Node name or GUI Text Node itself ---@param node string|node Node name or GUI Text Node itself
---@param value string|nil Initial text. Default value is node text from GUI scene. ---@param value string|nil Initial text. Default value is node text from GUI scene.
---@param adjust_type string Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference ---@param adjust_type string|nil Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference. Default: downscale
function druid__text.init(self, node, value, adjust_type) end function druid__text.init(self, node, value, adjust_type) end
--- Return true, if text with line break --- Return true, if text with line break
@ -1417,8 +1417,8 @@ function druid__text.set_to(self, set_to) end
---@class druid.text.style ---@class druid.text.style
---@field DEFAULT_ADJUST string The default adjust type for any text component ---@field DEFAULT_ADJUST string|nil The default adjust type for any text component. Default: DOWNSCALE
---@field TRIM_POSTFIX string The postfix for TRIM adjust type ---@field TRIM_POSTFIX string|nil The postfix for TRIM adjust type. Default: ...
local druid__text__style = {} local druid__text__style = {}
@ -1489,7 +1489,7 @@ function druid_instance.new_blocker(self, node) end
---@param node string|node The node_id or gui.get_node(node_id) ---@param node string|node The node_id or gui.get_node(node_id)
---@param callback function|nil Button callback ---@param callback function|nil Button callback
---@param params table|nil Button callback params ---@param params table|nil Button callback params
---@param anim_node node|nil Button anim node (node, if not provided) ---@param anim_node node|string|nil Button anim node (node, if not provided)
---@return druid.button @{Button} component ---@return druid.button @{Button} component
function druid_instance.new_button(self, node, callback, params, anim_node) end function druid_instance.new_button(self, node, callback, params, anim_node) end
@ -1504,9 +1504,9 @@ function druid_instance.new_checkbox(self, node, callback, click_node, initial_s
--- Create @{CheckboxGroup} component --- Create @{CheckboxGroup} component
---@param self druid_instance ---@param self druid_instance
---@param nodes node[] Array of gui node ---@param nodes (node|string)[] Array of gui node
---@param callback function Checkbox callback ---@param callback function Checkbox callback
---@param click_nodes node[] Array of trigger nodes, by default equals to nodes ---@param click_nodes (node|string)[]|nil Array of trigger nodes, by default equals to nodes
---@return druid.checkbox_group @{CheckboxGroup} component ---@return druid.checkbox_group @{CheckboxGroup} component
function druid_instance.new_checkbox_group(self, nodes, callback, click_nodes) end function druid_instance.new_checkbox_group(self, nodes, callback, click_nodes) end
@ -1549,7 +1549,7 @@ function druid_instance.new_hover(self, node, on_hover_callback) end
--- Create @{Input} component --- Create @{Input} component
---@param self druid_instance ---@param self druid_instance
---@param click_node string|node Button node to enabled input component ---@param click_node string|node Button node to enabled input component
---@param text_node string|node Text node what will be changed on user input ---@param text_node string|node|druid.text Text node what will be changed on user input
---@param keyboard_type number|nil Gui keyboard type for input field ---@param keyboard_type number|nil Gui keyboard type for input field
---@return druid.input @{Input} component ---@return druid.input @{Input} component
function druid_instance.new_input(self, click_node, text_node, keyboard_type) end function druid_instance.new_input(self, click_node, text_node, keyboard_type) end
@ -1566,8 +1566,9 @@ function druid_instance.new_lang_text(self, node, locale_id, adjust_type) end
---@param self druid_instance ---@param self druid_instance
---@param node string|node The_node id or gui.get_node(node_id). ---@param node string|node The_node id or gui.get_node(node_id).
---@param mode string The layout mode ---@param mode string The layout mode
---@param on_size_changed_callback function|nil The callback on window resize
---@return druid.layout @{Layout} component ---@return druid.layout @{Layout} component
function druid_instance.new_layout(self, node, mode) end function druid_instance.new_layout(self, node, mode, on_size_changed_callback) end
--- Create @{Progress} component --- Create @{Progress} component
---@param self druid_instance ---@param self druid_instance
@ -1579,9 +1580,9 @@ function druid_instance.new_progress(self, node, key, init_value) end
--- Create @{RadioGroup} component --- Create @{RadioGroup} component
---@param self druid_instance ---@param self druid_instance
---@param nodes node[] Array of gui node ---@param nodes (node|string)[] Array of gui node
---@param callback function Radio callback ---@param callback function Radio callback
---@param click_nodes node[] Array of trigger nodes, by default equals to nodes ---@param click_nodes (node|string)[]|nil Array of trigger nodes, by default equals to nodes
---@return druid.radio_group @{RadioGroup} component ---@return druid.radio_group @{RadioGroup} component
function druid_instance.new_radio_group(self, nodes, callback, click_nodes) end function druid_instance.new_radio_group(self, nodes, callback, click_nodes) end
@ -1665,14 +1666,14 @@ function druid_instance.remove(self, component) end
--- Set blacklist components for input processing. --- Set blacklist components for input processing.
--- If blacklist is not empty and component contains in this list, component will be not processed on input step --- If blacklist is not empty and component contains in this list, component will be not processed on input step
---@param self druid_instance @{DruidInstance} ---@param self druid_instance @{DruidInstance}
---@param blacklist_components table|druid.base_component The array of component to blacklist ---@param blacklist_components table|druid.base_component|nil The array of component to blacklist
---@return self @{DruidInstance} ---@return self @{DruidInstance}
function druid_instance.set_blacklist(self, blacklist_components) end function druid_instance.set_blacklist(self, blacklist_components) end
--- Set whitelist components for input processing. --- Set whitelist components for input processing.
--- If whitelist is not empty and component not contains in this list, component will be not processed on input step --- If whitelist is not empty and component not contains in this list, component will be not processed on input step
---@param self druid_instance ---@param self druid_instance
---@param whitelist_components table|druid.base_component The array of component to whitelist ---@param whitelist_components table|druid.base_component|nil The array of component to whitelist
---@return self @{DruidInstance} ---@return self @{DruidInstance}
function druid_instance.set_whitelist(self, whitelist_components) end function druid_instance.set_whitelist(self, whitelist_components) end

View File

@ -123,7 +123,7 @@
-- In default case equals to clickable node. -- In default case equals to clickable node.
-- --
-- Usecase: You have the big clickable panel, but want to animate only one small icon on it. -- Usecase: You have the big clickable panel, but want to animate only one small icon on it.
-- @tfield[opt=node] node anim_node -- @tfield node|nil anim_node Default node
---Custom args for any Button event. Setup in Button constructor ---Custom args for any Button event. Setup in Button constructor
-- @tfield any params -- @tfield any params
@ -258,9 +258,9 @@ end
-- You can override this component styles params in Druid styles table -- You can override this component styles params in Druid styles table
-- or create your own style -- or create your own style
-- @table style -- @table style
-- @tfield[opt=0.4] number LONGTAP_TIME Minimum time to trigger on_hold_callback -- @tfield number|nil LONGTAP_TIME Minimum time to trigger on_hold_callback. Default: 0.4
-- @tfield[opt=0.8] number AUTOHOLD_TRIGGER Maximum hold time to trigger button release while holding -- @tfield number|nil AUTOHOLD_TRIGGER Maximum hold time to trigger button release while holding. Default: 0.8
-- @tfield[opt=0.4] number DOUBLETAP_TIME Time between double taps -- @tfield number|nil DOUBLETAP_TIME Time between double taps. Default: 0.4
-- @tfield function on_click function(self, node) -- @tfield function on_click function(self, node)
-- @tfield function on_click_disabled function(self, node) -- @tfield function on_click_disabled function(self, node)
-- @tfield function on_hover function(self, node, hover_state) -- @tfield function on_hover function(self, node, hover_state)
@ -478,7 +478,7 @@ end
-- --
-- This functions calls automatically if you don't disable it in game.project: druid.no_stencil_check -- This functions calls automatically if you don't disable it in game.project: druid.no_stencil_check
-- @tparam Button self @{Button} -- @tparam Button self @{Button}
-- @tparam node|nil zone Gui node -- @tparam node|string|nil zone Gui node
-- @treturn Button Current button instance -- @treturn Button Current button instance
-- @usage -- @usage
-- button:set_click_zone("stencil_node") -- button:set_click_zone("stencil_node")

View File

@ -175,8 +175,8 @@ end
-- You can override this component styles params in druid styles table -- You can override this component styles params in druid styles table
-- or create your own style -- or create your own style
-- @table style -- @table style
-- @tfield[opt=10] number DRAG_DEADZONE Distance in pixels to start dragging -- @tfield number|nil DRAG_DEADZONE Distance in pixels to start dragging. Default: 10
-- @tfield[opt=false] boolean NO_USE_SCREEN_KOEF If screen aspect ratio affects on drag values -- @tfield boolean|nil NO_USE_SCREEN_KOEF If screen aspect ratio affects on drag values. Default: false
function Drag.on_style_change(self, style) function Drag.on_style_change(self, style)
self.style = {} self.style = {}
self.style.DRAG_DEADZONE = style.DRAG_DEADZONE or 10 self.style.DRAG_DEADZONE = style.DRAG_DEADZONE or 10
@ -324,7 +324,7 @@ end
--- Strict drag click area. Useful for --- Strict drag click area. Useful for
-- restrict events outside stencil node -- restrict events outside stencil node
-- @tparam Drag self @{Drag} -- @tparam Drag self @{Drag}
-- @tparam node node Gui node -- @tparam node|string|nil node Gui node
function Drag.set_click_zone(self, node) function Drag.set_click_zone(self, node)
self.click_zone = self:get_node(node) self.click_zone = self:get_node(node)
end end

View File

@ -128,7 +128,7 @@ end
--- Strict hover click area. Useful for --- Strict hover click area. Useful for
-- no click events outside stencil node -- no click events outside stencil node
-- @tparam Hover self @{Hover} -- @tparam Hover self @{Hover}
-- @tparam node zone Gui node -- @tparam node|string|nil zone Gui node
function Hover.set_click_zone(self, zone) function Hover.set_click_zone(self, zone)
self.click_zone = self:get_node(zone) self.click_zone = self:get_node(zone)
end end

View File

@ -123,18 +123,18 @@ end
-- You can override this component styles params in druid styles table -- You can override this component styles params in druid styles table
-- or create your own style -- or create your own style
-- @table style -- @table style
-- @tfield[opt=0] number FRICT Multiplier for free inertion -- @tfield number|nil FRICT Multiplier for free inertion. Default: 0
-- @tfield[opt=0] number FRICT_HOLD Multiplier for inertion, while touching -- @tfield number|nil FRICT_HOLD Multiplier for inertion, while touching. Default: 0
-- @tfield[opt=3] number INERT_THRESHOLD Scroll speed to stop inertion -- @tfield number|nil INERT_THRESHOLD Scroll speed to stop inertion. Default: 3
-- @tfield[opt=30] number INERT_SPEED Multiplier for inertion speed -- @tfield number|nil INERT_SPEED Multiplier for inertion speed. Default: 30
-- @tfield[opt=20] number POINTS_DEADZONE Speed to check points of interests in no_inertion mode -- @tfield number|nil POINTS_DEADZONE Speed to check points of interests in no_inertion mode. Default: 20
-- @tfield[opt=0.35] number BACK_SPEED Scroll back returning lerp speed -- @tfield number|nil BACK_SPEED Scroll back returning lerp speed. Default: 35
-- @tfield[opt=0.2] number ANIM_SPEED Scroll gui.animation speed for scroll_to function -- @tfield number|nil ANIM_SPEED Scroll gui.animation speed for scroll_to function. Default: 2
-- @tfield[opt=0] number EXTRA_STRETCH_SIZE extra size in pixels outside of scroll (stretch effect) -- @tfield number|nil EXTRA_STRETCH_SIZE extra size in pixels outside of scroll (stretch effect). Default: 0
-- @tfield[opt=false] boolean SMALL_CONTENT_SCROLL If true, content node with size less than view node size can be scrolled -- @tfield boolean|nil SMALL_CONTENT_SCROLL If true, content node with size less than view node size can be scrolled. Default: false
-- @tfield[opt=0] boolean WHEEL_SCROLL_SPEED The scroll speed via mouse wheel scroll or touchpad. Set to 0 to disable wheel scrolling -- @tfield boolean|nil WHEEL_SCROLL_SPEED The scroll speed via mouse wheel scroll or touchpad. Set to 0 to disable wheel scrolling. Default: 0
-- @tfield[opt=false] boolean WHEEL_SCROLL_INVERTED If true, invert direction for touchpad and mouse wheel scroll -- @tfield boolean|nil WHEEL_SCROLL_INVERTED If true, invert direction for touchpad and mouse wheel scroll. Default: false
-- @tfield[opt=false] boolean WHEEL_SCROLL_BY_INERTION If true, wheel will add inertion to scroll. Direct set position otherwise. -- @tfield boolean|nil WHEEL_SCROLL_BY_INERTION If true, wheel will add inertion to scroll. Direct set position otherwise.. Default: false
function Scroll.on_style_change(self, style) function Scroll.on_style_change(self, style)
self.style = {} self.style = {}
self.style.EXTRA_STRETCH_SIZE = style.EXTRA_STRETCH_SIZE or 0 self.style.EXTRA_STRETCH_SIZE = style.EXTRA_STRETCH_SIZE or 0
@ -325,7 +325,7 @@ end
-- It will change content gui node size -- It will change content gui node size
-- @tparam Scroll self @{Scroll} -- @tparam Scroll self @{Scroll}
-- @tparam vector3 size The new size for content node -- @tparam vector3 size The new size for content node
-- @tparam vector3 offset Offset value to set, where content is starts -- @tparam vector3|nil offset Offset value to set, where content is starts
-- @treturn druid.scroll Current scroll instance -- @treturn druid.scroll Current scroll instance
function Scroll.set_size(self, size, offset) function Scroll.set_size(self, size, offset)
if offset then if offset then
@ -493,7 +493,7 @@ end
--- Strict drag scroll area. Useful for --- Strict drag scroll area. Useful for
-- restrict events outside stencil node -- restrict events outside stencil node
-- @tparam Drag self -- @tparam Drag self
-- @tparam node node Gui node -- @tparam node|string node Gui node
function Scroll.set_click_zone(self, node) function Scroll.set_click_zone(self, node)
self.drag:set_click_zone(node) self.drag:set_click_zone(node)
end end

View File

@ -102,8 +102,8 @@ end
-- You can override this component styles params in druid styles table -- You can override this component styles params in druid styles table
-- or create your own style -- or create your own style
-- @table style -- @table style
-- @tfield[opt=false] boolean IS_DYNAMIC_NODE_POSES If true, always center grid content as grid pivot sets -- @tfield boolean|nil IS_DYNAMIC_NODE_POSES If true, always center grid content as grid pivot sets. Default: false
-- @tfield[opt=false] boolean IS_ALIGN_LAST_ROW If true, always align last row of the grid as grid pivot sets -- @tfield boolean|nil IS_ALIGN_LAST_ROW If true, always align last row of the grid as grid pivot sets. Default: false
function StaticGrid.on_style_change(self, style) function StaticGrid.on_style_change(self, style)
self.style = {} self.style = {}
self.style.IS_DYNAMIC_NODE_POSES = style.IS_DYNAMIC_NODE_POSES or false self.style.IS_DYNAMIC_NODE_POSES = style.IS_DYNAMIC_NODE_POSES or false
@ -115,7 +115,7 @@ end
-- @tparam StaticGrid self @{StaticGrid} -- @tparam StaticGrid self @{StaticGrid}
-- @tparam string|node parent The GUI Node container, where grid's items will be placed -- @tparam string|node parent The GUI Node container, where grid's items will be placed
-- @tparam node element Element prefab. Need to get it size -- @tparam node element Element prefab. Need to get it size
-- @tparam[opt=1] number in_row How many nodes in row can be placed -- @tparam number|nil in_row How many nodes in row can be placed. By default 1
function StaticGrid.init(self, parent, element, in_row) function StaticGrid.init(self, parent, element, in_row)
self.parent = self:get_node(parent) self.parent = self:get_node(parent)
self.nodes = {} self.nodes = {}

View File

@ -216,8 +216,8 @@ end
-- You can override this component styles params in druid styles table -- You can override this component styles params in druid styles table
-- or create your own style -- or create your own style
-- @table style -- @table style
-- @tfield[opt=...] string TRIM_POSTFIX The postfix for TRIM adjust type -- @tfield string|nil TRIM_POSTFIX The postfix for TRIM adjust type. Default: ...
-- @tfield[opt=DOWNSCALE] string DEFAULT_ADJUST The default adjust type for any text component -- @tfield string|nil DEFAULT_ADJUST The default adjust type for any text component. Default: DOWNSCALE
function Text.on_style_change(self, style) function Text.on_style_change(self, style)
self.style = {} self.style = {}
self.style.TRIM_POSTFIX = style.TRIM_POSTFIX or "..." self.style.TRIM_POSTFIX = style.TRIM_POSTFIX or "..."
@ -229,7 +229,7 @@ end
-- @tparam Text self @{Text} -- @tparam Text self @{Text}
-- @tparam string|node node Node name or GUI Text Node itself -- @tparam string|node node Node name or GUI Text Node itself
-- @tparam string|nil value Initial text. Default value is node text from GUI scene. -- @tparam string|nil value Initial text. Default value is node text from GUI scene.
-- @tparam[opt=downscale] string adjust_type Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference -- @tparam string|nil adjust_type Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference. Default: downscale
function Text.init(self, node, value, adjust_type) function Text.init(self, node, value, adjust_type)
self.node = self:get_node(node) self.node = self:get_node(node)
self.pos = gui.get_position(self.node) self.pos = gui.get_position(self.node)

View File

@ -87,7 +87,7 @@ end
--- Set current and min/max angles for component --- Set current and min/max angles for component
-- @tparam PinKnob self @{PinKnob} -- @tparam PinKnob self @{PinKnob}
-- @tparam[opt=1] number value The spin speed multiplier -- @tparam number|nil value The spin speed multiplier. Default: 1
-- @treturn PinKnob @{PinKnob} -- @treturn PinKnob @{PinKnob}
function PinKnob.set_friction(self, value) function PinKnob.set_friction(self, value)
self._friction = value or 1 self._friction = value or 1

View File

@ -138,9 +138,9 @@ end
-- You can override this component styles params in Druid styles table -- You can override this component styles params in Druid styles table
-- or create your own style -- or create your own style
-- @table style -- @table style
-- @tfield[opt={}] table COLORS Rich Text color aliases -- @tfield table|nil COLORS Rich Text color aliases. Default: {}
-- @tfield[opt=20] number ADJUST_STEPS Amount steps of attemps text adjust by height -- @tfield number|nil ADJUST_STEPS Amount steps of attemps text adjust by height. Default: 20
-- @tfield[opt=0.02] number ADJUST_SCALE_DELTA Scale step on each height adjust step -- @tfield number|nil ADJUST_SCALE_DELTA Scale step on each height adjust step. Default: 0.02
function RichText.on_style_change(self, style) function RichText.on_style_change(self, style)
self.style = {} self.style = {}
self.style.COLORS = style.COLORS or {} self.style.COLORS = style.COLORS or {}

View File

@ -14,7 +14,7 @@
-- @tfield node node -- @tfield node node
--- Button trigger node --- Button trigger node
-- @tfield[opt=node] node click_node -- @tfield node|nil click_node
--- Button component from click_node --- Button component from click_node
-- @tfield Button button @{Button} -- @tfield Button button @{Button}
@ -50,8 +50,8 @@ end
-- @tparam Checkbox self @{Checkbox} -- @tparam Checkbox self @{Checkbox}
-- @tparam node node Gui node -- @tparam node node Gui node
-- @tparam function callback Checkbox callback -- @tparam function callback Checkbox callback
-- @tparam[opt=node] node click_node Trigger node, by default equals to node -- @tparam node|nil click_node Trigger node, by default equals to node. Default: node
-- @tparam[opt=false] boolean initial_state The initial state of checkbox, default - false -- @tparam boolean|nil initial_state The initial state of checkbox, default - false
function Checkbox.init(self, node, callback, click_node, initial_state) function Checkbox.init(self, node, callback, click_node, initial_state)
self.druid = self:get_druid() self.druid = self:get_druid()
self.node = self:get_node(node) self.node = self:get_node(node)

View File

@ -25,7 +25,7 @@ local CheckboxGroup = component.create("checkbox_group")
-- @tparam CheckboxGroup self @{CheckboxGroup} -- @tparam CheckboxGroup self @{CheckboxGroup}
-- @tparam node[] nodes Array of gui node -- @tparam node[] nodes Array of gui node
-- @tparam function callback Checkbox callback -- @tparam function callback Checkbox callback
-- @tparam[opt=node] node[] click_nodes Array of trigger nodes, by default equals to nodes -- @tparam node[]|nil click_nodes Array of trigger nodes, by default equals to nodes
function CheckboxGroup.init(self, nodes, callback, click_nodes) function CheckboxGroup.init(self, nodes, callback, click_nodes)
self.druid = self:get_druid() self.druid = self:get_druid()
self.checkboxes = {} self.checkboxes = {}

View File

@ -101,7 +101,7 @@ end
-- @tparam number index The grid element index -- @tparam number index The grid element index
-- @tparam node node The node to be placed -- @tparam node node The node to be placed
-- @tparam number|nil origin_index Index of nearby node -- @tparam number|nil origin_index Index of nearby node
-- @treturn vector3 Node position -- @treturn vector3 node position
function DynamicGrid.get_pos(self, index, node, origin_index) function DynamicGrid.get_pos(self, index, node, origin_index)
local origin_node = self.nodes[origin_index] local origin_node = self.nodes[origin_index]

View File

@ -14,7 +14,7 @@
-- @tfield node node -- @tfield node node
--- Button trigger node --- Button trigger node
-- @tfield[opt=node] node click_node -- @tfield node|nil click_node
--- Button component from click_node --- Button component from click_node
-- @tfield Button button @{Button} -- @tfield Button button @{Button}

View File

@ -87,10 +87,10 @@ end
-- You can override this component styles params in druid styles table -- You can override this component styles params in druid styles table
-- or create your own style -- or create your own style
-- @table style -- @table style
-- @tfield[opt=false] boolean IS_LONGTAP_ERASE Is long tap will erase current input data -- @tfield boolean IS_LONGTAP_ERASE Is long tap will erase current input data. Default: false
-- @tfield[opt=*] string MASK_DEFAULT_CHAR Default character mask for password input -- @tfield string MASK_DEFAULT_CHAR Default character mask for password input. Default: *]
-- @tfield[opt=false] boolean IS_UNSELECT_ON_RESELECT If true, call unselect on select selected input -- @tfield boolean IS_UNSELECT_ON_RESELECT If true, call unselect on select selected input. Default: false
-- @tfield[opt=false] boolean NO_CONSUME_INPUT_WHILE_SELECTED If true, will not consume input while input is selected. It's allow to interact with other components while input is selected (text input still captured) -- @tfield boolean NO_CONSUME_INPUT_WHILE_SELECTED If true, will not consume input while input is selected. It's allow to interact with other components while input is selected (text input still captured). Default: false
-- @tfield function on_select (self, button_node) Callback on input field selecting -- @tfield function on_select (self, button_node) Callback on input field selecting
-- @tfield function on_unselect (self, button_node) Callback on input field unselecting -- @tfield function on_unselect (self, button_node) Callback on input field unselecting
-- @tfield function on_input_wrong (self, button_node) Callback on wrong user input -- @tfield function on_input_wrong (self, button_node) Callback on wrong user input

View File

@ -38,8 +38,8 @@ local LangText = component.create("lang_text")
--- The @{LangText} constructor --- The @{LangText} constructor
-- @tparam LangText self @{LangText} -- @tparam LangText self @{LangText}
-- @tparam string|node node The node_id or gui.get_node(node_id) -- @tparam string|node node The node_id or gui.get_node(node_id)
-- @tparam[opt=node_text] string locale_id Default locale id or text from node as default -- @tparam string|nil locale_id Default locale id or text from node as default
-- @tparam[opt=downscale] string adjust_type Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference -- @tparam string|nil adjust_type Adjust type for text. By default is DOWNSCALE. Look const.TEXT_ADJUST for reference
function LangText.init(self, node, locale_id, adjust_type) function LangText.init(self, node, locale_id, adjust_type)
self.druid = self:get_druid() self.druid = self:get_druid()
self.text = self.druid:new_text(node, locale_id, adjust_type) self.text = self.druid:new_text(node, locale_id, adjust_type)

View File

@ -101,8 +101,8 @@ end
-- You can override this component styles params in druid styles table -- You can override this component styles params in druid styles table
-- or create your own style -- or create your own style
-- @table style -- @table style
-- @tfield[opt=5] number SPEED Progress bas fill rate. More -> faster -- @tfield number|nil SPEED Progress bas fill rate. More -> faster. Default: 5
-- @tfield[opt=0.005] number MIN_DELTA Minimum step to fill progress bar -- @tfield number|nil MIN_DELTA Minimum step to fill progress bar. Default: 0.005
function Progress.on_style_change(self, style) function Progress.on_style_change(self, style)
self.style = {} self.style = {}
self.style.SPEED = style.SPEED or 5 self.style.SPEED = style.SPEED or 5
@ -114,7 +114,7 @@ end
-- @tparam Progress self @{Progress} -- @tparam Progress self @{Progress}
-- @tparam string|node node Node name or GUI Node itself. -- @tparam string|node node Node name or GUI Node itself.
-- @tparam string key Progress bar direction: const.SIDE.X or const.SIDE.Y -- @tparam string key Progress bar direction: const.SIDE.X or const.SIDE.Y
-- @tparam[opt=1] number init_value Initial value of progress bar -- @tparam number|nil init_value Initial value of progress bar. Default: 1
function Progress.init(self, node, key, init_value) function Progress.init(self, node, key, init_value)
assert(key == const.SIDE.X or const.SIDE.Y, "Progress bar key should be 'x' or 'y'") assert(key == const.SIDE.X or const.SIDE.Y, "Progress bar key should be 'x' or 'y'")

View File

@ -34,7 +34,7 @@ end
-- @tparam RadioGroup self @{RadioGroup} -- @tparam RadioGroup self @{RadioGroup}
-- @tparam node[] nodes Array of gui node -- @tparam node[] nodes Array of gui node
-- @tparam function callback Radio callback -- @tparam function callback Radio callback
-- @tparam[opt=node] node[] click_nodes Array of trigger nodes, by default equals to nodes -- @tparam node[]|nil click_nodes Array of trigger nodes, by default equals to nodes. Default - nodes
function RadioGroup.init(self, nodes, callback, click_nodes) function RadioGroup.init(self, nodes, callback, click_nodes)
self.druid = self:get_druid() self.druid = self:get_druid()
self.checkboxes = {} self.checkboxes = {}

View File

@ -202,7 +202,7 @@ end
-- move at this position and node drag will start. -- move at this position and node drag will start.
-- This function require the Defold version 1.3.0+ -- This function require the Defold version 1.3.0+
-- @tparam Slider self @{Slider} -- @tparam Slider self @{Slider}
-- @tparam node input_node -- @tparam node|string|nil input_node
-- @treturn Slider @{Slider} -- @treturn Slider @{Slider}
function Slider.set_input_node(self, input_node) function Slider.set_input_node(self, input_node)
self._input_node = self:get_node(input_node) self._input_node = self:get_node(input_node)

View File

@ -74,9 +74,9 @@ end
-- You can override this component styles params in druid styles table -- You can override this component styles params in druid styles table
-- or create your own style -- or create your own style
-- @table style -- @table style
-- @tfield[opt=0.4] number SWIPE_TIME Maximum time for swipe trigger -- @tfield number|nil SWIPE_TIME Maximum time for swipe trigger. Default: 0.4
-- @tfield[opt=50] number SWIPE_THRESHOLD Minimum distance for swipe trigger -- @tfield number|nil SWIPE_THRESHOLD Minimum distance for swipe trigger. Default: 50
-- @tfield[opt=false] boolean SWIPE_TRIGGER_ON_MOVE If true, trigger on swipe moving, not only release action -- @tfield boolean|nil SWIPE_TRIGGER_ON_MOVE If true, trigger on swipe moving, not only release action. Default: false
function Swipe.on_style_change(self, style) function Swipe.on_style_change(self, style)
self.style = {} self.style = {}
self.style.SWIPE_TIME = style.SWIPE_TIME or 0.4 self.style.SWIPE_TIME = style.SWIPE_TIME or 0.4
@ -150,7 +150,7 @@ end
--- Strict swipe click area. Useful for --- Strict swipe click area. Useful for
-- restrict events outside stencil node -- restrict events outside stencil node
-- @tparam Swipe self @{Swipe} -- @tparam Swipe self @{Swipe}
-- @tparam node zone Gui node -- @tparam node|string|nil zone Gui node
function Swipe.set_click_zone(self, zone) function Swipe.set_click_zone(self, zone)
self.click_zone = self:get_node(zone) self.click_zone = self:get_node(zone)
end end

View File

@ -473,7 +473,7 @@ end
-- If whitelist is not empty and component not contains in this list, -- If whitelist is not empty and component not contains in this list,
-- component will be not processed on input step -- component will be not processed on input step
-- @tparam DruidInstance self -- @tparam DruidInstance self
-- @tparam[opt=nil] table|BaseComponent whitelist_components The array of component to whitelist -- @tparam table|BaseComponent|nil whitelist_components The array of component to whitelist
-- @treturn self @{DruidInstance} -- @treturn self @{DruidInstance}
function DruidInstance.set_whitelist(self, whitelist_components) function DruidInstance.set_whitelist(self, whitelist_components)
if whitelist_components and whitelist_components.isInstanceOf then if whitelist_components and whitelist_components.isInstanceOf then
@ -495,7 +495,7 @@ end
-- If blacklist is not empty and component contains in this list, -- If blacklist is not empty and component contains in this list,
-- component will be not processed on input step -- component will be not processed on input step
-- @tparam DruidInstance self @{DruidInstance} -- @tparam DruidInstance self @{DruidInstance}
-- @tparam[opt=nil] table|BaseComponent blacklist_components The array of component to blacklist -- @tparam table|BaseComponent|nil blacklist_components The array of component to blacklist
-- @treturn self @{DruidInstance} -- @treturn self @{DruidInstance}
function DruidInstance.set_blacklist(self, blacklist_components) function DruidInstance.set_blacklist(self, blacklist_components)
if blacklist_components and blacklist_components.isInstanceOf then if blacklist_components and blacklist_components.isInstanceOf then
@ -557,7 +557,7 @@ end
-- @tparam string|node node The node_id or gui.get_node(node_id) -- @tparam string|node node The node_id or gui.get_node(node_id)
-- @tparam function|nil callback Button callback -- @tparam function|nil callback Button callback
-- @tparam table|nil params Button callback params -- @tparam table|nil params Button callback params
-- @tparam node|nil anim_node Button anim node (node, if not provided) -- @tparam node|string|nil anim_node Button anim node (node, if not provided)
-- @treturn Button @{Button} component -- @treturn Button @{Button} component
function DruidInstance.new_button(self, node, callback, params, anim_node) function DruidInstance.new_button(self, node, callback, params, anim_node)
return DruidInstance.new(self, button, node, callback, params, anim_node) return DruidInstance.new(self, button, node, callback, params, anim_node)
@ -705,7 +705,7 @@ end
--- Create @{Input} component --- Create @{Input} component
-- @tparam DruidInstance self -- @tparam DruidInstance self
-- @tparam string|node click_node Button node to enabled input component -- @tparam string|node click_node Button node to enabled input component
-- @tparam string|node text_node Text node what will be changed on user input -- @tparam string|node|druid.text text_node Text node what will be changed on user input
-- @tparam number|nil keyboard_type Gui keyboard type for input field -- @tparam number|nil keyboard_type Gui keyboard type for input field
-- @treturn Input @{Input} component -- @treturn Input @{Input} component
function DruidInstance.new_input(self, click_node, text_node, keyboard_type) function DruidInstance.new_input(self, click_node, text_node, keyboard_type)
@ -715,9 +715,9 @@ end
--- Create @{CheckboxGroup} component --- Create @{CheckboxGroup} component
-- @tparam DruidInstance self -- @tparam DruidInstance self
-- @tparam node[] nodes Array of gui node -- @tparam (node|string)[] nodes Array of gui node
-- @tparam function callback Checkbox callback -- @tparam function callback Checkbox callback
-- @tparam[opt=node] node[] click_nodes Array of trigger nodes, by default equals to nodes -- @tparam (node|string)[]|nil click_nodes Array of trigger nodes, by default equals to nodes
-- @treturn CheckboxGroup @{CheckboxGroup} component -- @treturn CheckboxGroup @{CheckboxGroup} component
function DruidInstance.new_checkbox_group(self, nodes, callback, click_nodes) function DruidInstance.new_checkbox_group(self, nodes, callback, click_nodes)
return helper.require_component_message("checkbox_group") return helper.require_component_message("checkbox_group")
@ -737,9 +737,9 @@ end
--- Create @{RadioGroup} component --- Create @{RadioGroup} component
-- @tparam DruidInstance self -- @tparam DruidInstance self
-- @tparam node[] nodes Array of gui node -- @tparam (node|string)[] nodes Array of gui node
-- @tparam function callback Radio callback -- @tparam function callback Radio callback
-- @tparam[opt=node] node[] click_nodes Array of trigger nodes, by default equals to nodes -- @tparam (node|string)[]|nil click_nodes Array of trigger nodes, by default equals to nodes
-- @treturn RadioGroup @{RadioGroup} component -- @treturn RadioGroup @{RadioGroup} component
function DruidInstance.new_radio_group(self, nodes, callback, click_nodes) function DruidInstance.new_radio_group(self, nodes, callback, click_nodes)
return helper.require_component_message("radio_group") return helper.require_component_message("radio_group")
@ -773,8 +773,9 @@ end
-- @tparam DruidInstance self -- @tparam DruidInstance self
-- @tparam string|node node The_node id or gui.get_node(node_id). -- @tparam string|node node The_node id or gui.get_node(node_id).
-- @tparam string mode The layout mode -- @tparam string mode The layout mode
-- @tparam function|nil on_size_changed_callback The callback on window resize
-- @treturn Layout @{Layout} component -- @treturn Layout @{Layout} component
function DruidInstance.new_layout(self, node, mode) function DruidInstance.new_layout(self, node, mode, on_size_changed_callback)
return helper.require_component_message("layout") return helper.require_component_message("layout")
end end

View File

@ -1,3 +1,5 @@
---@diagnostic disable: duplicate-doc-field
-- Manual Annotations -- -- Manual Annotations --
---@class druid.rich_text.metrics ---@class druid.rich_text.metrics