Merge pull request #247 from Insality/update_annotations

Update Druid annotations
This commit is contained in:
Maksim Tuprikov 2023-10-20 11:26:19 +03:00 committed by GitHub
commit 5d4039da4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
77 changed files with 1453 additions and 1143 deletions

View File

@ -12,7 +12,7 @@ jobs:
lfs: true
- uses: actions/setup-java@v1
with:
java-version: '13'
java-version: '17'
- name: Build && Run
run: |

View File

@ -16,3 +16,4 @@ date,sha,version,build_size,build_time,platform,mode,is_cache_using,commits_coun
2023-08-05T16:02:55Z,628723386eb3875f7190d079a2e7c510d044a311,0.11.692,2456,40,js-web,release,true,692
2023-08-05T16:31:19Z,37fff52aa59feb20f761ef4d340d9f677743d54b,0.11.693,2456,43,js-web,release,true,693
2023-08-05T16:41:25Z,d7dd4a86b81d73d345ad7e136de9c2c488bc4d8b,0.11.694,2452,43,js-web,release,true,694
2023-10-20T08:23:33Z,9132dc477b645d674ec21efbfcf85f48ef0ea8a6,0.11.718,2544,47,js-web,release,true,718

1 date sha version build_size build_time platform mode is_cache_using commits_count
16 2023-08-05T16:02:55Z 628723386eb3875f7190d079a2e7c510d044a311 0.11.692 2456 40 js-web release true 692
17 2023-08-05T16:31:19Z 37fff52aa59feb20f761ef4d340d9f677743d54b 0.11.693 2456 43 js-web release true 693
18 2023-08-05T16:41:25Z d7dd4a86b81d73d345ad7e136de9c2c488bc4d8b 0.11.694 2452 43 js-web release true 694
19 2023-10-20T08:23:33Z 9132dc477b645d674ec21efbfcf85f48ef0ea8a6 0.11.718 2544 47 js-web release true 718

View File

@ -1 +1 @@
{"content":[{"name":"game.projectc","size":4114,"pieces":[{"name":"game.projectc0","offset":0}]},{"name":"game.arci","size":23008,"pieces":[{"name":"game.arci0","offset":0}]},{"name":"game.arcd","size":607568,"pieces":[{"name":"game.arcd0","offset":0}]},{"name":"game.dmanifest","size":24253,"pieces":[{"name":"game.dmanifest0","offset":0}]},{"name":"game.public.der","size":162,"pieces":[{"name":"game.public.der0","offset":0}]}]}
{"content":[{"name":"game.projectc","size":4141,"pieces":[{"name":"game.projectc0","offset":0}]},{"name":"game.arci","size":23248,"pieces":[{"name":"game.arci0","offset":0}]},{"name":"game.arcd","size":608384,"pieces":[{"name":"game.arcd0","offset":0}]},{"name":"game.dmanifest","size":26065,"pieces":[{"name":"game.dmanifest0","offset":0}]},{"name":"game.public.der","size":162,"pieces":[{"name":"game.public.der0","offset":0}]}]}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,12 +1,12 @@
[project]
title = druid
version = 0.11.694
version = 0.11.718
write_log = 0
compress_archive = 1
publisher = Insality
developer = Insality
commit_sha = d7dd4a86b81d73d345ad7e136de9c2c488bc4d8b
build_date = 2023-08-05T16:41:25Z
commit_sha = 9132dc477b645d674ec21efbfcf85f48ef0ea8a6
build_date = 2023-10-20T08:23:33Z
title_as_file_name = druid
[display]
@ -102,6 +102,7 @@ max_count = 0
max_count = 64
max_particlefx_count = 64
max_particle_count = 1024
max_animation_count = 1024
[collection]
max_instances = 128
@ -126,7 +127,7 @@ default_language = en
localizations = en
[android]
version_code = 694
version_code = 718
minimum_sdk_version = 19
target_sdk_version = 33
package = com.insality.druid

View File

@ -132,7 +132,10 @@ var EngineLoader = {
async function fetchWithProgress(path) {
const response = await fetch(path);
// May be incorrect if compressed
const contentLength = response.headers.get("Content-Length");
var contentLength = response.headers.get("Content-Length");
if (!contentLength){
contentLength = EngineLoader.wasm_size;
}
const total = parseInt(contentLength, 10);
let bytesLoaded = 0;
@ -725,7 +728,7 @@ var Module = {
FS.syncfs(true, function(err) {
if (err) {
Module._syncTries += 1;
console.error("FS syncfs error: " + err);
console.warn("Unable to synchronize mounted file systems: " + err);
if (Module._syncMaxTries > Module._syncTries) {
Module.preSync(done);
} else {
@ -847,7 +850,7 @@ var Module = {
Module._syncInProgress = false;
if (err) {
console.error("Module._startSyncFS error: " + err);
console.warn("Unable to synchronize mounted file systems: " + err);
Module._syncTries += 1;
}

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- The above 4 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>druid 0.11.694</title>
<title>druid 0.11.718</title>
<style type='text/css'>
/* Disable user selection to avoid strange bug in Chrome on Windows:
* Selecting a text outside the canvas, then clicking+draging would
@ -165,6 +165,8 @@
return scriptDirectory + path;
};
var is_iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
var buttonHeight = 0;
var prevInnerWidth = -1;

View File

@ -98,67 +98,67 @@ return AwesomeComponent
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#component:get_childrens">component:get_childrens(self)</a></td>
<td class="name" nowrap><a href="#get_childrens">get_childrens(self)</a></td>
<td class="summary">Return all children components, recursive</td>
</tr>
<tr>
<td class="name" nowrap><a href="#component:get_context">component:get_context(self)</a></td>
<td class="name" nowrap><a href="#get_context">get_context(self)</a></td>
<td class="summary">Context used as first arg in all Druid events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#component:get_druid">component:get_druid(self)</a></td>
<td class="name" nowrap><a href="#get_druid">get_druid(self)</a></td>
<td class="summary">Get Druid instance for inner component creation.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#component:get_input_priority">component:get_input_priority(self)</a></td>
<td class="name" nowrap><a href="#get_input_priority">get_input_priority(self)</a></td>
<td class="summary">Return component input priority</td>
</tr>
<tr>
<td class="name" nowrap><a href="#component:get_name">component:get_name(self)</a></td>
<td class="name" nowrap><a href="#get_name">get_name(self)</a></td>
<td class="summary">Return component name</td>
</tr>
<tr>
<td class="name" nowrap><a href="#component:get_node">component:get_node(self, node_or_name)</a></td>
<td class="name" nowrap><a href="#get_node">get_node(self, node_or_name)</a></td>
<td class="summary">Get component node by name.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#component:get_parent_component">component:get_parent_component(self)</a></td>
<td class="name" nowrap><a href="#get_parent_component">get_parent_component(self)</a></td>
<td class="summary">Return the parent component if exist</td>
</tr>
<tr>
<td class="name" nowrap><a href="#component:get_parent_name">component:get_parent_name(self)</a></td>
<td class="name" nowrap><a href="#get_parent_name">get_parent_name(self)</a></td>
<td class="summary">Return parent component name</td>
</tr>
<tr>
<td class="name" nowrap><a href="#component:get_template">component:get_template(self)</a></td>
<td class="name" nowrap><a href="#get_template">get_template(self)</a></td>
<td class="summary">Get current component template name.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#component:get_uid">component:get_uid(self)</a></td>
<td class="name" nowrap><a href="#get_uid">get_uid(self)</a></td>
<td class="summary">Return component UID.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#component:reset_input_priority">component:reset_input_priority(self)</a></td>
<td class="name" nowrap><a href="#reset_input_priority">reset_input_priority(self)</a></td>
<td class="summary">Reset component input priority to default value</td>
</tr>
<tr>
<td class="name" nowrap><a href="#component:set_input_enabled">component:set_input_enabled(self, state)</a></td>
<td class="name" nowrap><a href="#set_input_enabled">set_input_enabled(self, state)</a></td>
<td class="summary">Set component input state.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#component:set_input_priority">component:set_input_priority(self, value, is_temporary)</a></td>
<td class="name" nowrap><a href="#set_input_priority">set_input_priority(self, value, is_temporary)</a></td>
<td class="summary">Set component input priority</td>
</tr>
<tr>
<td class="name" nowrap><a href="#component:set_nodes">component:set_nodes(self, nodes)</a></td>
<td class="name" nowrap><a href="#set_nodes">set_nodes(self, nodes)</a></td>
<td class="summary">Set current component nodes.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#component:set_style">component:set_style(self, druid_style)</a></td>
<td class="name" nowrap><a href="#set_style">set_style(self, druid_style)</a></td>
<td class="summary">Set current component style table.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#component:set_template">component:set_template(self, template)</a></td>
<td class="name" nowrap><a href="#set_template">set_template(self, template)</a></td>
<td class="summary">Set component template name.</td>
</tr>
</table>
@ -171,8 +171,8 @@ return AwesomeComponent
<dl class="function">
<dt>
<a name = "component:get_childrens"></a>
<strong>component:get_childrens(self)</strong>
<a name = "get_childrens"></a>
<strong>get_childrens(self)</strong>
</dt>
<dd>
Return all children components, recursive
@ -198,8 +198,8 @@ return AwesomeComponent
</dd>
<dt>
<a name = "component:get_context"></a>
<strong>component:get_context(self)</strong>
<a name = "get_context"></a>
<strong>get_context(self)</strong>
</dt>
<dd>
Context used as first arg in all Druid events Context is usually self of gui_script.
@ -225,8 +225,8 @@ return AwesomeComponent
</dd>
<dt>
<a name = "component:get_druid"></a>
<strong>component:get_druid(self)</strong>
<a name = "get_druid"></a>
<strong>get_druid(self)</strong>
</dt>
<dd>
Get Druid instance for inner component creation.
@ -243,7 +243,7 @@ return AwesomeComponent
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Druid</span></span>
<span class="types"><span class="type">DruidInstance</span></span>
Druid instance with component context
</ol>
@ -252,8 +252,8 @@ return AwesomeComponent
</dd>
<dt>
<a name = "component:get_input_priority"></a>
<strong>component:get_input_priority(self)</strong>
<a name = "get_input_priority"></a>
<strong>get_input_priority(self)</strong>
</dt>
<dd>
Return component input priority
@ -279,8 +279,8 @@ return AwesomeComponent
</dd>
<dt>
<a name = "component:get_name"></a>
<strong>component:get_name(self)</strong>
<a name = "get_name"></a>
<strong>get_name(self)</strong>
</dt>
<dd>
Return component name
@ -306,8 +306,8 @@ return AwesomeComponent
</dd>
<dt>
<a name = "component:get_node"></a>
<strong>component:get_node(self, node_or_name)</strong>
<a name = "get_node"></a>
<strong>get_node(self, node_or_name)</strong>
</dt>
<dd>
Get component node by name.
@ -341,8 +341,8 @@ return AwesomeComponent
</dd>
<dt>
<a name = "component:get_parent_component"></a>
<strong>component:get_parent_component(self)</strong>
<a name = "get_parent_component"></a>
<strong>get_parent_component(self)</strong>
</dt>
<dd>
Return the parent component if exist
@ -368,8 +368,8 @@ return AwesomeComponent
</dd>
<dt>
<a name = "component:get_parent_name"></a>
<strong>component:get_parent_name(self)</strong>
<a name = "get_parent_name"></a>
<strong>get_parent_name(self)</strong>
</dt>
<dd>
Return parent component name
@ -395,8 +395,8 @@ return AwesomeComponent
</dd>
<dt>
<a name = "component:get_template"></a>
<strong>component:get_template(self)</strong>
<a name = "get_template"></a>
<strong>get_template(self)</strong>
</dt>
<dd>
Get current component template name.
@ -422,8 +422,8 @@ return AwesomeComponent
</dd>
<dt>
<a name = "component:get_uid"></a>
<strong>component:get_uid(self)</strong>
<a name = "get_uid"></a>
<strong>get_uid(self)</strong>
</dt>
<dd>
Return component UID.
@ -450,8 +450,8 @@ return AwesomeComponent
</dd>
<dt>
<a name = "component:reset_input_priority"></a>
<strong>component:reset_input_priority(self)</strong>
<a name = "reset_input_priority"></a>
<strong>reset_input_priority(self)</strong>
</dt>
<dd>
Reset component input priority to default value
@ -477,8 +477,8 @@ return AwesomeComponent
</dd>
<dt>
<a name = "component:set_input_enabled"></a>
<strong>component:set_input_enabled(self, state)</strong>
<a name = "set_input_enabled"></a>
<strong>set_input_enabled(self, state)</strong>
</dt>
<dd>
Set component input state. By default it enabled
@ -492,7 +492,7 @@ return AwesomeComponent
<a href="../modules/BaseComponent.html#">BaseComponent</a>
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
The component input state
</li>
</ul>
@ -509,8 +509,8 @@ return AwesomeComponent
</dd>
<dt>
<a name = "component:set_input_priority"></a>
<strong>component:set_input_priority(self, value, is_temporary)</strong>
<a name = "set_input_priority"></a>
<strong>set_input_priority(self, value, is_temporary)</strong>
</dt>
<dd>
Set component input priority Default value: 10
@ -527,7 +527,7 @@ return AwesomeComponent
The new input priority value
</li>
<li><span class="parameter">is_temporary</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, the reset input priority will return to previous value
</li>
</ul>
@ -544,8 +544,8 @@ return AwesomeComponent
</dd>
<dt>
<a name = "component:set_nodes"></a>
<strong>component:set_nodes(self, nodes)</strong>
<a name = "set_nodes"></a>
<strong>set_nodes(self, nodes)</strong>
</dt>
<dd>
Set current component nodes.
@ -582,8 +582,8 @@ self:set_nodes(nodes)</pre>
</dd>
<dt>
<a name = "component:set_style"></a>
<strong>component:set_style(self, druid_style)</strong>
<a name = "set_style"></a>
<strong>set_style(self, druid_style)</strong>
</dt>
<dd>
Set current component style table.
@ -598,7 +598,7 @@ self:set_nodes(nodes)</pre>
<a href="../modules/BaseComponent.html#">BaseComponent</a>
</li>
<li><span class="parameter">druid_style</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>
Druid style module
</li>
</ul>
@ -615,8 +615,8 @@ self:set_nodes(nodes)</pre>
</dd>
<dt>
<a name = "component:set_template"></a>
<strong>component:set_template(self, template)</strong>
<a name = "set_template"></a>
<strong>set_template(self, template)</strong>
</dt>
<dd>
Set component template name.

View File

@ -95,7 +95,7 @@ local blocker = self.druid:new_blocker(node)
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(self, node)</a></td>
<td class="summary"><a href="../modules/Blocker.html#">Blocker</a> constructor</td>
<td class="summary">The <a href="../modules/Blocker.html#">Blocker</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_enabled">is_enabled(self)</a></td>
@ -126,7 +126,7 @@ local blocker = self.druid:new_blocker(node)
<strong>init(self, node)</strong>
</dt>
<dd>
<a href="../modules/Blocker.html#">Blocker</a> constructor
The <a href="../modules/Blocker.html#">Blocker</a> constructor
<h3>Parameters:</h3>
@ -165,8 +165,8 @@ local blocker = self.druid:new_blocker(node)
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
True, if blocker is enabled
<span class="types"><span class="type">boolean</span></span>
@True, if blocker is enabled
</ol>
@ -189,7 +189,7 @@ local blocker = self.druid:new_blocker(node)
<a href="../modules/Blocker.html#">Blocker</a>
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
Enabled state
</li>
</ul>

View File

@ -97,7 +97,7 @@
print(&quot;Also the button component is passed in callback params&quot;)
end
local custom_args = &quot;Any variable to pass inside callback&quot;
local custom_args = &quot;any variable to pass inside callback&quot;
local button = self.druid:new_button(&quot;button_name&quot;, on_button_click, custom_args)
</pre>
</ul>
@ -110,7 +110,7 @@ local button = self.druid:new_button(&quot;button_name&quot;, on_button_click, c
<td class="summary">Get current key name to trigger this button.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#init">init(self, node, callback[, custom_args[, anim_node]])</a></td>
<td class="name" nowrap><a href="#init">init(self, node, callback, custom_args, anim_node)</a></td>
<td class="summary">The <a href="../modules/Button.html#">Button</a> constructor</td>
</tr>
<tr>
@ -118,7 +118,7 @@ local button = self.druid:new_button(&quot;button_name&quot;, on_button_click, c
<td class="summary">Get button enabled state.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_check_function">set_check_function(self[, check_function[, failure_callback]])</a></td>
<td class="name" nowrap><a href="#set_check_function">set_check_function(self, check_function, failure_callback)</a></td>
<td class="summary">Set function for additional check for button click availability</td>
</tr>
<tr>
@ -134,7 +134,7 @@ local button = self.druid:new_button(&quot;button_name&quot;, on_button_click, c
<td class="summary">Set key name to trigger this button by keyboard.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_web_user_interaction">set_web_user_interaction(self[, is_web_mode])</a></td>
<td class="name" nowrap><a href="#set_web_user_interaction">set_web_user_interaction(self, is_web_mode)</a></td>
<td class="summary">Set Button mode to work inside user HTML5 interaction event.</td>
</tr>
</table>
@ -241,7 +241,7 @@ local button = self.druid:new_button(&quot;button_name&quot;, on_button_click, c
</dd>
<dt>
<a name = "init"></a>
<strong>init(self, node, callback[, custom_args[, anim_node]])</strong>
<strong>init(self, node, callback, custom_args, anim_node)</strong>
</dt>
<dd>
The <a href="../modules/Button.html#">Button</a> constructor
@ -254,22 +254,20 @@ local button = self.druid:new_button(&quot;button_name&quot;, on_button_click, c
<a href="../modules/Button.html#">Button</a>
</li>
<li><span class="parameter">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>
Node name or GUI Node itself
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <a class="type" href="../modules/Button.html#node">node</a></span>
The node_id or gui.get_node(node_id)
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
On click button callback
</li>
<li><span class="parameter">custom_args</span>
<span class="types"><span class="type">any</span></span>
<span class="types"><span class="type">any</span> or <span class="type">nil</span></span>
Button events custom arguments
(<em>optional</em>)
</li>
<li><span class="parameter">anim_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>, <a class="type" href="../modules/Button.html#node">node</a> or <span class="type">nil</span></span>
Node to animate instead of trigger node.
(<em>optional</em>)
</li>
</ul>
@ -298,8 +296,8 @@ local button = self.druid:new_button(&quot;button_name&quot;, on_button_click, c
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
True, if button is enabled now, False overwise
<span class="types"><span class="type">boolean</span></span>
@True, if button is enabled now, False overwise
</ol>
@ -312,7 +310,7 @@ local button = self.druid:new_button(&quot;button_name&quot;, on_button_click, c
</dd>
<dt>
<a name = "set_check_function"></a>
<strong>set_check_function(self[, check_function[, failure_callback]])</strong>
<strong>set_check_function(self, check_function, failure_callback)</strong>
</dt>
<dd>
Set function for additional check for button click availability
@ -325,14 +323,12 @@ local button = self.druid:new_button(&quot;button_name&quot;, on_button_click, c
</li>
<li><span class="parameter">check_function</span>
<span class="types"><span class="type">function</span></span>
<span class="types"><span class="type">function</span> or <span class="type">nil</span></span>
Should return true or false. If true - button can be pressed.
(<em>optional</em>)
</li>
<li><span class="parameter">failure_callback</span>
<span class="types"><span class="type">function</span></span>
<span class="types"><span class="type">function</span> or <span class="type">nil</span></span>
Function will be called on button click, if check function return false
(<em>optional</em>)
</li>
</ul>
@ -364,7 +360,7 @@ local button = self.druid:new_button(&quot;button_name&quot;, on_button_click, c
<a href="../modules/Button.html#">Button</a>
</li>
<li><span class="parameter">zone</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>
Gui node
</li>
</ul>
@ -401,7 +397,7 @@ local button = self.druid:new_button(&quot;button_name&quot;, on_button_click, c
<a href="../modules/Button.html#">Button</a>
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
Enabled state
</li>
</ul>
@ -459,7 +455,7 @@ button:set_enabled(<span class="keyword">true</span>)</pre>
</dd>
<dt>
<a name = "set_web_user_interaction"></a>
<strong>set_web_user_interaction(self[, is_web_mode])</strong>
<strong>set_web_user_interaction(self, is_web_mode)</strong>
</dt>
<dd>
Set Button mode to work inside user HTML5 interaction event.
@ -475,9 +471,8 @@ button:set_enabled(<span class="keyword">true</span>)</pre>
</li>
<li><span class="parameter">is_web_mode</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 - button will be called inside html5 callback
(<em>optional</em>)
</li>
</ul>
@ -529,23 +524,23 @@ button:set_enabled(<span class="keyword">true</span>)</pre>
</li>
<li><span class="parameter">on_click</span>
<span class="types"><span class="type">function</span></span>
(self, node)
function(self, node)
</li>
<li><span class="parameter">on_click_disabled</span>
<span class="types"><span class="type">function</span></span>
(self, node)
function(self, node)
</li>
<li><span class="parameter">on_hover</span>
<span class="types"><span class="type">function</span></span>
(self, node, hover_state)
function(self, node, hover_state)
</li>
<li><span class="parameter">on_mouse_hover</span>
<span class="types"><span class="type">function</span></span>
(self, node, hover_state)
function(self, node, hover_state)
</li>
<li><span class="parameter">on_set_enabled</span>
<span class="types"><span class="type">function</span></span>
(self, node, enabled_state)
function(self, node, enabled_state)
</li>
</ul>
@ -632,7 +627,7 @@ button:set_enabled(<span class="keyword">true</span>)</pre>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">Node</span></span>
<span class="types"><a class="type" href="../modules/Button.html#node">node</a></span>
</li>
</ul>

View File

@ -88,7 +88,7 @@
</tr>
<tr>
<td class="name" nowrap><a href="#init">init(self, node, callback[, click_node=node[, initial_state=false]])</a></td>
<td class="summary">Component init function</td>
<td class="summary">The <a href="../modules/Checkbox.html#">Checkbox</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_state">set_state(self, state, is_silent, is_instant)</a></td>
@ -148,7 +148,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
Checkbox state
</ol>
@ -161,7 +161,7 @@
<strong>init(self, node, callback[, click_node=node[, initial_state=false]])</strong>
</dt>
<dd>
Component init function
The <a href="../modules/Checkbox.html#">Checkbox</a> constructor
<h3>Parameters:</h3>
@ -210,15 +210,15 @@
<a href="../modules/Checkbox.html#">Checkbox</a>
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
Checkbox state
</li>
<li><span class="parameter">is_silent</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
Don't trigger on_change_state if true
</li>
<li><span class="parameter">is_instant</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
If instant checkbox change
</li>
</ul>

View File

@ -87,7 +87,7 @@
</tr>
<tr>
<td class="name" nowrap><a href="#init">init(self, nodes, callback[, click_nodes=node])</a></td>
<td class="summary">Component init function</td>
<td class="summary">The <a href="../modules/CheckboxGroup.html#">CheckboxGroup</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_state">set_state(self, indexes, is_instant)</a></td>
@ -132,7 +132,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool[]</span></span>
<span class="types"><span class="type">boolean[]</span></span>
Array if checkboxes state
</ol>
@ -145,7 +145,7 @@
<strong>init(self, nodes, callback[, click_nodes=node])</strong>
</dt>
<dd>
Component init function
The <a href="../modules/CheckboxGroup.html#">CheckboxGroup</a> constructor
<h3>Parameters:</h3>
@ -189,11 +189,11 @@
<a href="../modules/CheckboxGroup.html#">CheckboxGroup</a>
</li>
<li><span class="parameter">indexes</span>
<span class="types"><span class="type">bool[]</span></span>
<span class="types"><span class="type">boolean[]</span></span>
Array of checkbox state
</li>
<li><span class="parameter">is_instant</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 instant state change
</li>
</ul>

View File

@ -117,7 +117,7 @@
</tr>
<tr>
<td class="name" nowrap><a href="#init">init(self, scroll, grid, create_function)</a></td>
<td class="summary">Data list constructor</td>
<td class="summary">The <a href="../modules/DataList.html#">DataList</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_remove">on_remove(self)</a></td>
@ -242,7 +242,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Node[]</span></span>
<span class="types"><span class="type">node[]</span></span>
List of created nodes
</ol>
@ -370,7 +370,7 @@
<strong>init(self, scroll, grid, create_function)</strong>
</dt>
<dd>
Data list constructor
The <a href="../modules/DataList.html#">DataList</a> constructor
<h3>Parameters:</h3>

View File

@ -88,7 +88,7 @@
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(self, node, on_drag_callback)</a></td>
<td class="summary">Drag component constructor</td>
<td class="summary">The <a href="../modules/Drag.html#">Drag</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_enabled">is_enabled(self)</a></td>
@ -174,7 +174,7 @@
<strong>init(self, node, on_drag_callback)</strong>
</dt>
<dd>
Drag component constructor
The <a href="../modules/Drag.html#">Drag</a> constructor
<h3>Parameters:</h3>
@ -217,7 +217,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
</ol>
@ -266,7 +266,7 @@
<a href="../modules/Drag.html#">Drag</a>
</li>
<li><span class="parameter">is_enabled</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
</li>
</ul>
@ -323,7 +323,7 @@
<ul>
<li><span class="parameter">can_x</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
</li>
</ul>
@ -343,7 +343,7 @@
<ul>
<li><span class="parameter">can_y</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
</li>
</ul>
@ -363,7 +363,7 @@
<ul>
<li><span class="parameter">is_drag</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
</li>
</ul>
@ -383,7 +383,7 @@
<ul>
<li><span class="parameter">is_touch</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
</li>
</ul>

View File

@ -120,7 +120,7 @@ end
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#druid.new">druid.new(context[, style])</a></td>
<td class="name" nowrap><a href="#druid.new">druid.new(context, style)</a></td>
<td class="summary">Create a new Druid instance for creating GUI components.</td>
</tr>
<tr>
@ -158,7 +158,7 @@ end
<dl class="function">
<dt>
<a name = "druid.new"></a>
<strong>druid.new(context[, style])</strong>
<strong>druid.new(context, style)</strong>
</dt>
<dd>
Create a new Druid instance for creating GUI components.
@ -171,9 +171,8 @@ end
The Druid context. Usually, this is the self of the gui_script. It is passed into all Druid callbacks.
</li>
<li><span class="parameter">style</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>
The Druid style table to override style parameters for this Druid instance.
(<em>optional</em>)
</li>
</ul>

View File

@ -87,7 +87,7 @@
<td class="summary">Clear the all event handlers</td>
</tr>
<tr>
<td class="name" nowrap><a href="#initialize">initialize(self[, initial_callback])</a></td>
<td class="name" nowrap><a href="#initialize">initialize(self, initial_callback)</a></td>
<td class="summary">DruidEvent constructor</td>
</tr>
<tr>
@ -95,7 +95,7 @@
<td class="summary">Return true, if event have at lease one handler</td>
</tr>
<tr>
<td class="name" nowrap><a href="#subscribe">subscribe(self, callback[, context])</a></td>
<td class="name" nowrap><a href="#subscribe">subscribe(self, callback, context)</a></td>
<td class="summary">Subscribe callback on event</td>
</tr>
<tr>
@ -103,7 +103,7 @@
<td class="summary">Trigger the event and call all subscribed callbacks</td>
</tr>
<tr>
<td class="name" nowrap><a href="#unsubscribe">unsubscribe(self, callback[, context])</a></td>
<td class="name" nowrap><a href="#unsubscribe">unsubscribe(self, callback, context)</a></td>
<td class="summary">Unsubscribe callback on event</td>
</tr>
</table>
@ -142,7 +142,7 @@
</dd>
<dt>
<a name = "initialize"></a>
<strong>initialize(self[, initial_callback])</strong>
<strong>initialize(self, initial_callback)</strong>
</dt>
<dd>
DruidEvent constructor
@ -155,9 +155,8 @@
<a href="../modules/DruidEvent.html#">DruidEvent</a>
</li>
<li><span class="parameter">initial_callback</span>
<span class="types"><span class="type">function</span></span>
<span class="types"><span class="type">function</span> or <span class="type">nil</span></span>
Subscribe the callback on new event, if callback exist
(<em>optional</em>)
</li>
</ul>
@ -191,7 +190,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
True if event have handlers
</ol>
@ -205,7 +204,7 @@
</dd>
<dt>
<a name = "subscribe"></a>
<strong>subscribe(self, callback[, context])</strong>
<strong>subscribe(self, callback, context)</strong>
</dt>
<dd>
Subscribe callback on event
@ -222,9 +221,8 @@
Callback itself
</li>
<li><span class="parameter">context</span>
<span class="types"><span class="type">Any</span></span>
<span class="types"><span class="type">any</span> or <span class="type">nil</span></span>
Additional context as first param to callback call, usually it's self
(<em>optional</em>)
</li>
</ul>
@ -257,7 +255,7 @@ button.on_long_click:subscribe(on_long_callback, self)</pre>
<a href="../modules/DruidEvent.html#">DruidEvent</a>
</li>
<li><span class="parameter">...</span>
<span class="types"><span class="type">Any</span></span>
<span class="types"><span class="type">any</span></span>
All event params
</li>
</ul>
@ -276,7 +274,7 @@ event:trigger(<span class="string">"Param1"</span>, <span class="string">"Param2
</dd>
<dt>
<a name = "unsubscribe"></a>
<strong>unsubscribe(self, callback[, context])</strong>
<strong>unsubscribe(self, callback, context)</strong>
</dt>
<dd>
Unsubscribe callback on event
@ -293,9 +291,8 @@ event:trigger(<span class="string">"Param1"</span>, <span class="string">"Param2
Callback itself
</li>
<li><span class="parameter">context</span>
<span class="types"><span class="type">Any</span></span>
<span class="types"><span class="type">any</span> or <span class="type">nil</span></span>
Additional context as first param to callback call
(<em>optional</em>)
</li>
</ul>

View File

@ -146,7 +146,7 @@ end
<td class="summary">Create new component.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#new_back_handler">new_back_handler(self, callback[, params])</a></td>
<td class="name" nowrap><a href="#new_back_handler">new_back_handler(self, callback, params)</a></td>
<td class="summary">Create <a href="../modules/BackHandler.html#">BackHandler</a> component</td>
</tr>
<tr>
@ -154,11 +154,11 @@ end
<td class="summary">Create <a href="../modules/Blocker.html#">Blocker</a> component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#new_button">new_button(self, node, callback[, params[, anim_node]])</a></td>
<td class="name" nowrap><a href="#new_button">new_button(self, node, callback, params, anim_node)</a></td>
<td class="summary">Create <a href="../modules/Button.html#">Button</a> component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#new_checkbox">new_checkbox(self, node, callback[, click_node=node[, initial_state=false]])</a></td>
<td class="name" nowrap><a href="#new_checkbox">new_checkbox(self, node, callback, click_node, initial_state)</a></td>
<td class="summary">Create <a href="../modules/Checkbox.html#">Checkbox</a> component</td>
</tr>
<tr>
@ -174,11 +174,11 @@ end
<td class="summary">Create <a href="../modules/Drag.html#">Drag</a> component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#new_dynamic_grid">new_dynamic_grid(self, parent)</a></td>
<td class="name" nowrap><a href="#new_dynamic_grid">new_dynamic_grid(self, parent_node)</a></td>
<td class="summary">Create <a href="../modules/DynamicGrid.html#">DynamicGrid</a> component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#new_hotkey">new_hotkey(self, keys_array, callback[, params])</a></td>
<td class="name" nowrap><a href="#new_hotkey">new_hotkey(self, keys_array, callback, callback_argument)</a></td>
<td class="summary">Create <a href="../modules/Hotkey.html#">Hotkey</a> component</td>
</tr>
<tr>
@ -186,11 +186,11 @@ end
<td class="summary">Create <a href="../modules/Hover.html#">Hover</a> component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#new_input">new_input(self, click_node, text_node[, keyboard_type])</a></td>
<td class="name" nowrap><a href="#new_input">new_input(self, click_node, text_node, keyboard_type)</a></td>
<td class="summary">Create <a href="../modules/Input.html#">Input</a> component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#new_lang_text">new_lang_text(self, node, locale_id, no_adjust)</a></td>
<td class="name" nowrap><a href="#new_lang_text">new_lang_text(self, node, locale_id, adjust_type)</a></td>
<td class="summary">Create <a href="../modules/LangText.html#">LangText</a> component</td>
</tr>
<tr>
@ -198,7 +198,7 @@ end
<td class="summary">Create <a href="../modules/Layout.html#">Layout</a> component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#new_progress">new_progress(self, node, key[, init_value=1])</a></td>
<td class="name" nowrap><a href="#new_progress">new_progress(self, node, key, init_value)</a></td>
<td class="summary">Create <a href="../modules/Progress.html#">Progress</a> component</td>
</tr>
<tr>
@ -206,7 +206,7 @@ end
<td class="summary">Create <a href="../modules/RadioGroup.html#">RadioGroup</a> component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#new_rich_text">new_rich_text(self[, template[, nodes]])</a></td>
<td class="name" nowrap><a href="#new_rich_text">new_rich_text(self, template, nodes)</a></td>
<td class="summary">Create <a href="../modules/RichText.html#">RichText</a> component.</td>
</tr>
<tr>
@ -214,11 +214,11 @@ end
<td class="summary">Create <a href="../modules/Scroll.html#">Scroll</a> component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#new_slider">new_slider(self, node, end_pos[, callback])</a></td>
<td class="name" nowrap><a href="#new_slider">new_slider(self, pin_node, end_pos, callback)</a></td>
<td class="summary">Create <a href="../modules/Slider.html#">Slider</a> component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#new_static_grid">new_static_grid(self, parent, element[, in_row=1])</a></td>
<td class="name" nowrap><a href="#new_static_grid">new_static_grid(self, parent_node, item, in_row)</a></td>
<td class="summary">Create <a href="../modules/StaticGrid.html#">StaticGrid</a> component</td>
</tr>
<tr>
@ -226,11 +226,11 @@ end
<td class="summary">Create <a href="../modules/Swipe.html#">Swipe</a> component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#new_text">new_text(self, node[, value[, no_adjust]])</a></td>
<td class="name" nowrap><a href="#new_text">new_text(self, node, value, no_adjust)</a></td>
<td class="summary">Create <a href="../modules/Text.html#">Text</a> component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#new_timer">new_timer(self, node, seconds_from[, seconds_to=0[, callback]])</a></td>
<td class="name" nowrap><a href="#new_timer">new_timer(self, node, seconds_from, seconds_to, callback)</a></td>
<td class="summary">Create <a href="../modules/Timer.html#">Timer</a> component</td>
</tr>
<tr>
@ -302,15 +302,21 @@ end
</li>
<li><span class="parameter">component</span>
<span class="types"><span class="type">Component</span></span>
<span class="types"><span class="type">BaseComponent</span></span>
Component module
</li>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
<span class="types"><span class="type">any</span></span>
Other component params to pass it to component:init function
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">BaseComponent</span></span>
Component instance
</ol>
@ -318,7 +324,7 @@ end
</dd>
<dt>
<a name = "new_back_handler"></a>
<strong>new_back_handler(self, callback[, params])</strong>
<strong>new_back_handler(self, callback, params)</strong>
</dt>
<dd>
Create <a href="../modules/BackHandler.html#">BackHandler</a> component
@ -331,13 +337,12 @@ end
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">callback</span></span>
On back button
<span class="types"><span class="type">function</span> or <span class="type">nil</span></span>
@The callback(self, custom_args) to call on back event
</li>
<li><span class="parameter">params</span>
<span class="types"><span class="type">any</span></span>
<span class="types"><span class="type">any</span> or <span class="type">nil</span></span>
Callback argument
(<em>optional</em>)
</li>
</ul>
@ -367,8 +372,8 @@ end
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui node
<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>
The node_id or gui.get_node(node_id)
</li>
</ul>
@ -385,7 +390,7 @@ end
</dd>
<dt>
<a name = "new_button"></a>
<strong>new_button(self, node, callback[, params[, anim_node]])</strong>
<strong>new_button(self, node, callback, params, anim_node)</strong>
</dt>
<dd>
Create <a href="../modules/Button.html#">Button</a> component
@ -398,22 +403,20 @@ end
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
GUI node
<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>
The node_id or gui.get_node(node_id)
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
<span class="types"><span class="type">function</span> or <span class="type">nil</span></span>
Button callback
</li>
<li><span class="parameter">params</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>
Button callback params
(<em>optional</em>)
</li>
<li><span class="parameter">anim_node</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>
Button anim node (node, if not provided)
(<em>optional</em>)
</li>
</ul>
@ -430,7 +433,7 @@ end
</dd>
<dt>
<a name = "new_checkbox"></a>
<strong>new_checkbox(self, node, callback[, click_node=node[, initial_state=false]])</strong>
<strong>new_checkbox(self, node, callback, click_node, initial_state)</strong>
</dt>
<dd>
Create <a href="../modules/Checkbox.html#">Checkbox</a> component
@ -443,22 +446,20 @@ end
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui node
<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>
The_node id or gui.get_node(node_id).
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
<span class="types"><span class="type">function</span> or <span class="type">nil</span></span>
Checkbox callback
</li>
<li><span class="parameter">click_node</span>
<span class="types"><span class="type">node</span></span>
Trigger node, by default equals to node
(<em>default</em> node)
<span class="types"><span class="type">node</span> or <span class="type">nil</span></span>
Trigger node, Default: node
</li>
<li><span class="parameter">initial_state</span>
<span class="types"><span class="type">boolean</span></span>
The initial state of checkbox, default - false
(<em>default</em> false)
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
The initial state of checkbox, Default: false
</li>
</ul>
@ -532,8 +533,8 @@ end
The Scroll instance for Data List component
</li>
<li><span class="parameter">druid_grid</span>
<span class="types"><span class="type">Grid</span></span>
The Grid instance for Data List component
<span class="types"><span class="type">StaticGrid</span> or <span class="type">DynamicGrid</span></span>
The <a href="../modules/StaticGrid.html#">StaticGrid</a> or <a href="../modules/DynamicGrid.html#">DynamicGrid</a> instance for Data List component
</li>
<li><span class="parameter">create_function</span>
<span class="types"><span class="type">function</span></span>
@ -567,11 +568,11 @@ end
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
GUI node to detect dragging
<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>
The node_id or gui.get_node(node_id). Will used as user input node.
</li>
<li><span class="parameter">on_drag_callback</span>
<span class="types"><span class="type">function</span></span>
<span class="types"><span class="type">function</span> or <span class="type">nil</span></span>
Callback for on_drag_event(self, dx, dy)
</li>
</ul>
@ -589,7 +590,7 @@ end
</dd>
<dt>
<a name = "new_dynamic_grid"></a>
<strong>new_dynamic_grid(self, parent)</strong>
<strong>new_dynamic_grid(self, parent_node)</strong>
</dt>
<dd>
Create <a href="../modules/DynamicGrid.html#">DynamicGrid</a> component
@ -601,9 +602,9 @@ end
<span class="types"><span class="type">DruidInstance</span></span>
</li>
<li><span class="parameter">parent</span>
<span class="types"><span class="type">node</span></span>
The gui node parent, where items will be placed
<li><span class="parameter">parent_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>
The node_id or gui.get_node(node_id). Parent of all Grid items.
</li>
</ul>
@ -620,7 +621,7 @@ end
</dd>
<dt>
<a name = "new_hotkey"></a>
<strong>new_hotkey(self, keys_array, callback[, params])</strong>
<strong>new_hotkey(self, keys_array, callback, callback_argument)</strong>
</dt>
<dd>
Create <a href="../modules/Hotkey.html#">Hotkey</a> component
@ -638,12 +639,11 @@ end
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Button callback
The callback function
</li>
<li><span class="parameter">params</span>
<span class="types"><span class="type">value</span></span>
Button callback params
(<em>optional</em>)
<li><span class="parameter">callback_argument</span>
<span class="types"><span class="type">any</span> or <span class="type">nil</span></span>
The argument to pass into the callback function
</li>
</ul>
@ -673,11 +673,11 @@ end
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui node
<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>
The node_id or gui.get_node(node_id)
</li>
<li><span class="parameter">on_hover_callback</span>
<span class="types"><span class="type">function</span></span>
<span class="types"><span class="type">function</span> or <span class="type">nil</span></span>
Hover callback
</li>
</ul>
@ -695,7 +695,7 @@ end
</dd>
<dt>
<a name = "new_input"></a>
<strong>new_input(self, click_node, text_node[, keyboard_type])</strong>
<strong>new_input(self, click_node, text_node, keyboard_type)</strong>
</dt>
<dd>
Create <a href="../modules/Input.html#">Input</a> component
@ -708,17 +708,16 @@ end
</li>
<li><span class="parameter">click_node</span>
<span class="types"><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> or <span class="type">node</span></span>
Button node to enabled input component
</li>
<li><span class="parameter">text_node</span>
<span class="types"><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> or <span class="type">node</span></span>
Text node what will be changed on user input
</li>
<li><span class="parameter">keyboard_type</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>
Gui keyboard type for input field
(<em>optional</em>)
</li>
</ul>
@ -735,7 +734,7 @@ end
</dd>
<dt>
<a name = "new_lang_text"></a>
<strong>new_lang_text(self, node, locale_id, no_adjust)</strong>
<strong>new_lang_text(self, node, locale_id, adjust_type)</strong>
</dt>
<dd>
Create <a href="../modules/LangText.html#">LangText</a> component
@ -748,16 +747,16 @@ end
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
The text node
<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>
The_node id or gui.get_node(node_id)
</li>
<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>
Default locale id
<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
</li>
<li><span class="parameter">no_adjust</span>
<span class="types"><span class="type">bool</span></span>
If true, will not correct text size
<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> or <span class="type">nil</span></span>
Adjust type for text node. Default: const.TEXT_ADJUST.DOWNSCALE
</li>
</ul>
@ -788,7 +787,7 @@ end
</li>
<li><span class="parameter">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>
Layout node
The_node id or gui.get_node(node_id).
</li>
<li><span class="parameter">mode</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
@ -809,7 +808,7 @@ end
</dd>
<dt>
<a name = "new_progress"></a>
<strong>new_progress(self, node, key[, init_value=1])</strong>
<strong>new_progress(self, node, key, init_value)</strong>
</dt>
<dd>
Create <a href="../modules/Progress.html#">Progress</a> component
@ -830,9 +829,8 @@ end
Progress bar direction: const.SIDE.X or const.SIDE.Y
</li>
<li><span class="parameter">init_value</span>
<span class="types"><span class="type">number</span></span>
Initial value of progress bar
(<em>default</em> 1)
<span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
Initial value of progress bar. Default: 1
</li>
</ul>
@ -889,7 +887,7 @@ end
</dd>
<dt>
<a name = "new_rich_text"></a>
<strong>new_rich_text(self[, template[, nodes]])</strong>
<strong>new_rich_text(self, template, nodes)</strong>
</dt>
<dd>
Create <a href="../modules/RichText.html#">RichText</a> component.
@ -903,14 +901,12 @@ end
</li>
<li><span class="parameter">template</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>
Template name if used
(<em>optional</em>)
</li>
<li><span class="parameter">nodes</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>
Nodes table from gui.clone_tree
(<em>optional</em>)
</li>
</ul>
@ -940,12 +936,12 @@ end
</li>
<li><span class="parameter">view_node</span>
<span class="types"><span class="type">node</span></span>
GUI view scroll node
<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>
The node_id or gui.get_node(node_id). Will used as user input node.
</li>
<li><span class="parameter">content_node</span>
<span class="types"><span class="type">node</span></span>
GUI content scroll node
<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>
The node_id or gui.get_node(node_id). Will used as scrollable node inside view_node.
</li>
</ul>
@ -962,7 +958,7 @@ end
</dd>
<dt>
<a name = "new_slider"></a>
<strong>new_slider(self, node, end_pos[, callback])</strong>
<strong>new_slider(self, pin_node, end_pos, callback)</strong>
</dt>
<dd>
Create <a href="../modules/Slider.html#">Slider</a> component
@ -974,18 +970,17 @@ end
<span class="types"><span class="type">DruidInstance</span></span>
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui pin node
<li><span class="parameter">pin_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>
The_node id or gui.get_node(node_id).
</li>
<li><span class="parameter">end_pos</span>
<span class="types"><span class="type">vector3</span></span>
The end position of slider
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
<span class="types"><span class="type">function</span> or <span class="type">nil</span></span>
On slider change callback
(<em>optional</em>)
</li>
</ul>
@ -1002,7 +997,7 @@ end
</dd>
<dt>
<a name = "new_static_grid"></a>
<strong>new_static_grid(self, parent, element[, in_row=1])</strong>
<strong>new_static_grid(self, parent_node, item, in_row)</strong>
</dt>
<dd>
Create <a href="../modules/StaticGrid.html#">StaticGrid</a> component
@ -1014,18 +1009,17 @@ end
<span class="types"><span class="type">DruidInstance</span></span>
</li>
<li><span class="parameter">parent</span>
<span class="types"><span class="type">node</span></span>
The gui node parent, where items will be placed
<li><span class="parameter">parent_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>
The node_id or gui.get_node(node_id). Parent of all Grid items.
</li>
<li><span class="parameter">element</span>
<span class="types"><span class="type">node</span></span>
Element prefab. Need to get it size
<li><span class="parameter">item</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>
Item prefab. Required to get grid's item size. Can be adjusted separately.
</li>
<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
(<em>default</em> 1)
</li>
</ul>
@ -1055,11 +1049,11 @@ end
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui node
<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>
The node_id or gui.get_node(node_id). Will used as user input node.
</li>
<li><span class="parameter">on_swipe_callback</span>
<span class="types"><span class="type">function</span></span>
<span class="types"><span class="type">function</span> or <span class="type">nil</span></span>
Swipe callback for on_swipe_end event
</li>
</ul>
@ -1077,7 +1071,7 @@ end
</dd>
<dt>
<a name = "new_text"></a>
<strong>new_text(self, node[, value[, no_adjust]])</strong>
<strong>new_text(self, node, value, no_adjust)</strong>
</dt>
<dd>
Create <a href="../modules/Text.html#">Text</a> component
@ -1090,18 +1084,16 @@ end
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui text node
<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>
The node_id or gui.get_node(node_id)
</li>
<li><span class="parameter">value</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>
Initial text. Default value is node text from GUI scene.
(<em>optional</em>)
</li>
<li><span class="parameter">no_adjust</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
If true, text will be not auto-adjust size
(<em>optional</em>)
</li>
</ul>
@ -1118,7 +1110,7 @@ end
</dd>
<dt>
<a name = "new_timer"></a>
<strong>new_timer(self, node, seconds_from[, seconds_to=0[, callback]])</strong>
<strong>new_timer(self, node, seconds_from, seconds_to, callback)</strong>
</dt>
<dd>
Create <a href="../modules/Timer.html#">Timer</a> component
@ -1131,7 +1123,7 @@ end
</li>
<li><span class="parameter">node</span>
<span class="types"><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> or <span class="type">node</span></span>
Gui text node
</li>
<li><span class="parameter">seconds_from</span>
@ -1139,14 +1131,12 @@ end
Start timer value in seconds
</li>
<li><span class="parameter">seconds_to</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>
End timer value in seconds
(<em>default</em> 0)
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
<span class="types"><span class="type">function</span> or <span class="type">nil</span></span>
Function on timer end
(<em>optional</em>)
</li>
</ul>
@ -1189,7 +1179,7 @@ end
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
The boolean value is input was consumed
</ol>
@ -1247,7 +1237,7 @@ end
</li>
<li><span class="parameter">component</span>
<span class="types"><span class="type">Component</span></span>
<span class="types"><span class="type">BaseComponent</span></span>
Component instance
</li>
</ul>
@ -1274,7 +1264,7 @@ end
<a href="../modules/DruidInstance.html#">DruidInstance</a>
</li>
<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">Component</span></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>
The array of component to blacklist
(<em>default</em> nil)
</li>
@ -1308,7 +1298,7 @@ end
</li>
<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">Component</span></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>
The array of component to whitelist
(<em>default</em> nil)
</li>

View File

@ -86,7 +86,7 @@
<td class="summary">Return side vector to correct node shifting</td>
</tr>
<tr>
<td class="name" nowrap><a href="#add">add(self, node[, index[, shift_policy=SHIFT.RIGHT[, is_instant=false]]])</a></td>
<td class="name" nowrap><a href="#add">add(self, node, index, shift_policy, is_instant)</a></td>
<td class="summary">Add new node to the grid</td>
</tr>
<tr>
@ -110,7 +110,7 @@
<td class="summary">Return DynamicGrid offset, where DynamicGrid content starts.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_pos">get_pos(self, index, node[, origin_index])</a></td>
<td class="name" nowrap><a href="#get_pos">get_pos(self, index, node, origin_index)</a></td>
<td class="summary">Return pos for grid node index</td>
</tr>
<tr>
@ -119,10 +119,10 @@
</tr>
<tr>
<td class="name" nowrap><a href="#init">init(self, parent)</a></td>
<td class="summary">Component init function</td>
<td class="summary">The <a href="../modules/DynamicGrid.html#">DynamicGrid</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#remove">remove(self, index[, shift_policy=SHIFT.RIGHT[, is_instant=false]])</a></td>
<td class="name" nowrap><a href="#remove">remove(self, index, shift_policy, is_instant)</a></td>
<td class="summary">Remove the item from the grid.</td>
</tr>
<tr>
@ -213,7 +213,7 @@
</dd>
<dt>
<a name = "add"></a>
<strong>add(self, node[, index[, shift_policy=SHIFT.RIGHT[, is_instant=false]]])</strong>
<strong>add(self, node, index, shift_policy, is_instant)</strong>
</dt>
<dd>
Add new node to the grid
@ -230,19 +230,16 @@
Gui node
</li>
<li><span class="parameter">index</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 node position. By default add as last node
(<em>optional</em>)
</li>
<li><span class="parameter">shift_policy</span>
<span class="types"><span class="type">number</span></span>
How shift nodes, if required. See const.SHIFT
(<em>default</em> SHIFT.RIGHT)
<span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
How shift nodes, if required. Default: const.SHIFT.RIGHT
</li>
<li><span class="parameter">is_instant</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, update node positions instantly
(<em>default</em> false)
</li>
</ul>
@ -393,7 +390,7 @@
</dd>
<dt>
<a name = "get_pos"></a>
<strong>get_pos(self, index, node[, origin_index])</strong>
<strong>get_pos(self, index, node, origin_index)</strong>
</dt>
<dd>
Return pos for grid node index
@ -414,9 +411,8 @@
The node to be placed
</li>
<li><span class="parameter">origin_index</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>
Index of nearby node
(<em>optional</em>)
</li>
</ul>
@ -467,7 +463,7 @@
<strong>init(self, parent)</strong>
</dt>
<dd>
Component init function
The <a href="../modules/DynamicGrid.html#">DynamicGrid</a> constructor
<h3>Parameters:</h3>
@ -489,7 +485,7 @@
</dd>
<dt>
<a name = "remove"></a>
<strong>remove(self, index[, shift_policy=SHIFT.RIGHT[, is_instant=false]])</strong>
<strong>remove(self, index, shift_policy, is_instant)</strong>
</dt>
<dd>
Remove the item from the grid. Note that gui node will be not deleted
@ -506,14 +502,12 @@
The grid node index to remove
</li>
<li><span class="parameter">shift_policy</span>
<span class="types"><span class="type">number</span></span>
How shift nodes, if required. See const.SHIFT
(<em>default</em> SHIFT.RIGHT)
<span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
How shift nodes, if required. Default: const.SHIFT.RIGHT
</li>
<li><span class="parameter">is_instant</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, update node positions instantly
(<em>default</em> false)
</li>
</ul>

View File

@ -87,11 +87,11 @@ helper.centrate_nodes(0, node_1, node_2)
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#helper.add_array">helper.add_array(target[, source])</a></td>
<td class="name" nowrap><a href="#helper.add_array">helper.add_array(target, source)</a></td>
<td class="summary">Add all elements from source array to the target array</td>
</tr>
<tr>
<td class="name" nowrap><a href="#helper.centrate_nodes">helper.centrate_nodes([margin=0], ...)</a></td>
<td class="name" nowrap><a href="#helper.centrate_nodes">helper.centrate_nodes(margin, ...)</a></td>
<td class="summary">Centerate nodes by x position with margin.</td>
</tr>
<tr>
@ -111,7 +111,7 @@ helper.centrate_nodes(0, node_1, node_2)
<td class="summary">Calculate distance between two points</td>
</tr>
<tr>
<td class="name" nowrap><a href="#helper.get_border">helper.get_border(node[, offset])</a></td>
<td class="name" nowrap><a href="#helper.get_border">helper.get_border(node, offset)</a></td>
<td class="summary">Distance from node position to his borders</td>
</tr>
<tr>
@ -143,7 +143,7 @@ helper.centrate_nodes(0, node_1, node_2)
<td class="summary">Get text metric from GUI node.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#helper.insert_with_shift">helper.insert_with_shift(array, item[, index[, shift_policy]])</a></td>
<td class="name" nowrap><a href="#helper.insert_with_shift">helper.insert_with_shift(array, any, index, shift_policy)</a></td>
<td class="summary">Add value to array with shift policy</td>
</tr>
<tr>
@ -159,11 +159,11 @@ helper.centrate_nodes(0, node_1, node_2)
<td class="summary">Lerp between two values</td>
</tr>
<tr>
<td class="name" nowrap><a href="#helper.remove_with_shift">helper.remove_with_shift(array[, index[, shift_policy]])</a></td>
<td class="name" nowrap><a href="#helper.remove_with_shift">helper.remove_with_shift(array, index, shift_policy)</a></td>
<td class="summary">Remove value from array with shift policy</td>
</tr>
<tr>
<td class="name" nowrap><a href="#helper.round">helper.round(num[, num_decimal_places=0])</a></td>
<td class="name" nowrap><a href="#helper.round">helper.round(num, num_decimal_places)</a></td>
<td class="summary">Round number to specified decimal places</td>
</tr>
<tr>
@ -189,7 +189,7 @@ helper.centrate_nodes(0, node_1, node_2)
<dl class="function">
<dt>
<a name = "helper.add_array"></a>
<strong>helper.add_array(target[, source])</strong>
<strong>helper.add_array(target, source)</strong>
</dt>
<dd>
Add all elements from source array to the target array
@ -198,20 +198,19 @@ helper.centrate_nodes(0, node_1, node_2)
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">target</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"><span class="type">any[]</span></span>
Array to put elements from source
</li>
<li><span class="parameter">source</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"><span class="type">any[]</span> or <span class="type">nil</span></span>
The source array to get elements from
(<em>optional</em>)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">array</span></span>
<span class="types"><span class="type">any[]</span></span>
The target array
</ol>
@ -221,7 +220,7 @@ helper.centrate_nodes(0, node_1, node_2)
</dd>
<dt>
<a name = "helper.centrate_nodes"></a>
<strong>helper.centrate_nodes([margin=0], ...)</strong>
<strong>helper.centrate_nodes(margin, ...)</strong>
</dt>
<dd>
Centerate nodes by x position with margin.
@ -232,9 +231,8 @@ helper.centrate_nodes(0, node_1, node_2)
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">margin</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>
Offset between nodes
(<em>default</em> 0)
</li>
<li><span class="parameter">...</span>
Gui nodes
@ -379,7 +377,7 @@ helper.centrate_nodes(0, node_1, node_2)
</dd>
<dt>
<a name = "helper.get_border"></a>
<strong>helper.get_border(node[, offset])</strong>
<strong>helper.get_border(node, offset)</strong>
</dt>
<dd>
Distance from node position to his borders
@ -392,9 +390,8 @@ helper.centrate_nodes(0, node_1, node_2)
GUI node
</li>
<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 from node position. Pass current node position to get non relative border values
(<em>optional</em>)
</li>
</ul>
@ -471,8 +468,8 @@ helper.centrate_nodes(0, node_1, node_2)
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">pivot</span>
<span class="types"><span class="type">gui.pivot</span></span>
The node pivot
<span class="types"><span class="type">number</span></span>
The gui.PIVOT_* constant
</li>
</ul>
@ -529,7 +526,7 @@ helper.centrate_nodes(0, node_1, node_2)
Gui node
</li>
<li><span class="parameter">include_passed_node_scale</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
True if add current node scale to result
</li>
</ul>
@ -579,7 +576,7 @@ helper.centrate_nodes(0, node_1, node_2)
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">text_node</span>
<span class="types"><span class="type">Node</span></span>
<span class="types"><span class="type">node</span></span>
</li>
</ul>
@ -606,7 +603,7 @@ helper.centrate_nodes(0, node_1, node_2)
</dd>
<dt>
<a name = "helper.insert_with_shift"></a>
<strong>helper.insert_with_shift(array, item[, index[, shift_policy]])</strong>
<strong>helper.insert_with_shift(array, any, index, shift_policy)</strong>
</dt>
<dd>
Add value to array with shift policy Shift policy can be: left, right, no_shift
@ -618,25 +615,23 @@ helper.centrate_nodes(0, node_1, node_2)
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
Array
</li>
<li><span class="parameter">item</span>
<li><span class="parameter">any</span>
Item to insert
</li>
<li><span class="parameter">index</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>
Index to insert. If nil, item will be inserted at the end of array
(<em>optional</em>)
</li>
<li><span class="parameter">shift_policy</span>
<span class="types"><span class="type">const.SHIFT</span></span>
Shift policy
(<em>optional</em>)
<span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
The druid_const.SHIFT.* constant
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">item</span></span>
<span class="types"><span class="type">any</span></span>
Inserted item
</ol>
@ -656,7 +651,7 @@ helper.centrate_nodes(0, node_1, node_2)
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
Is mobile
</ol>
@ -676,7 +671,7 @@ helper.centrate_nodes(0, node_1, node_2)
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
Is web
</ol>
@ -721,7 +716,7 @@ helper.centrate_nodes(0, node_1, node_2)
</dd>
<dt>
<a name = "helper.remove_with_shift"></a>
<strong>helper.remove_with_shift(array[, index[, shift_policy]])</strong>
<strong>helper.remove_with_shift(array, index, shift_policy)</strong>
</dt>
<dd>
Remove value from array with shift policy Shift policy can be: left, right, no_shift
@ -734,21 +729,19 @@ helper.centrate_nodes(0, node_1, node_2)
Array
</li>
<li><span class="parameter">index</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>
Index to remove. If nil, item will be removed from the end of array
(<em>optional</em>)
</li>
<li><span class="parameter">shift_policy</span>
<span class="types"><span class="type">const.SHIFT</span></span>
Shift policy
(<em>optional</em>)
<span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
The druid_const.SHIFT.* constant
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">item</span></span>
<span class="types"><span class="type">any</span></span>
Removed item
</ol>
@ -758,7 +751,7 @@ helper.centrate_nodes(0, node_1, node_2)
</dd>
<dt>
<a name = "helper.round"></a>
<strong>helper.round(num[, num_decimal_places=0])</strong>
<strong>helper.round(num, num_decimal_places)</strong>
</dt>
<dd>
Round number to specified decimal places
@ -771,9 +764,8 @@ helper.centrate_nodes(0, node_1, node_2)
Number
</li>
<li><span class="parameter">num_decimal_places</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>
Decimal places
(<em>default</em> 0)
</li>
</ul>

View File

@ -83,12 +83,12 @@
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#add_hotkey">add_hotkey(self, keys[, callback_argument])</a></td>
<td class="name" nowrap><a href="#add_hotkey">add_hotkey(self, keys, callback_argument)</a></td>
<td class="summary">Add hotkey for component callback</td>
</tr>
<tr>
<td class="name" nowrap><a href="#init">init(self, keys, callback[, callback_argument])</a></td>
<td class="summary">Component init function</td>
<td class="name" nowrap><a href="#init">init(self, keys, callback, callback_argument)</a></td>
<td class="summary">The <a href="../modules/Hotkey.html#">Hotkey</a> constructor</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
@ -127,7 +127,7 @@
<dl class="function">
<dt>
<a name = "add_hotkey"></a>
<strong>add_hotkey(self, keys[, callback_argument])</strong>
<strong>add_hotkey(self, keys, callback_argument)</strong>
</dt>
<dd>
Add hotkey for component callback
@ -144,12 +144,17 @@
that have to be pressed before key pressed to activate
</li>
<li><span class="parameter">callback_argument</span>
<span class="types"><span class="type">value</span></span>
<span class="types"><span class="type">any</span> or <span class="type">nil</span></span>
The argument to pass into the callback function
(<em>optional</em>)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Hotkey</span></span>
Current instance
</ol>
@ -157,10 +162,10 @@
</dd>
<dt>
<a name = "init"></a>
<strong>init(self, keys, callback[, callback_argument])</strong>
<strong>init(self, keys, callback, callback_argument)</strong>
</dt>
<dd>
Component init function
The <a href="../modules/Hotkey.html#">Hotkey</a> constructor
<h3>Parameters:</h3>
@ -178,9 +183,8 @@
The callback function
</li>
<li><span class="parameter">callback_argument</span>
<span class="types"><span class="type">value</span></span>
<span class="types"><span class="type">any</span> or <span class="type">nil</span></span>
The argument to pass into the callback function
(<em>optional</em>)
</li>
</ul>

View File

@ -83,7 +83,7 @@
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(self, node, on_hover_callback)</a></td>
<td class="summary">Component init function</td>
<td class="summary">The <a href="../modules/Hover.html#">Hover</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_enabled">is_enabled(self)</a></td>
@ -138,7 +138,7 @@
<strong>init(self, node, on_hover_callback)</strong>
</dt>
<dd>
Component init function
The <a href="../modules/Hover.html#">Hover</a> constructor
<h3>Parameters:</h3>
@ -181,7 +181,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
The hover enabled state
</ol>
@ -208,7 +208,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
The current hovered state
</ol>
@ -235,7 +235,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
The current hovered state
</ol>
@ -286,7 +286,7 @@
<a href="../modules/Hover.html#">Hover</a>
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
The hover enabled state
</li>
</ul>
@ -311,7 +311,7 @@
<a href="../modules/Hover.html#">Hover</a>
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
The hover state
</li>
</ul>
@ -336,7 +336,7 @@
<a href="../modules/Hover.html#">Hover</a>
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
The mouse hover state
</li>
</ul>

View File

@ -93,8 +93,8 @@
<td class="summary">Return current input field text</td>
</tr>
<tr>
<td class="name" nowrap><a href="#init">init(self, click_node, text_node[, keyboard_type])</a></td>
<td class="summary">Component init function</td>
<td class="name" nowrap><a href="#init">init(self, click_node, text_node, keyboard_type)</a></td>
<td class="summary">The <a href="../modules/Input.html#">Input</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#reset_changes">reset_changes(self)</a></td>
@ -220,10 +220,10 @@
</dd>
<dt>
<a name = "init"></a>
<strong>init(self, click_node, text_node[, keyboard_type])</strong>
<strong>init(self, click_node, text_node, keyboard_type)</strong>
</dt>
<dd>
Component init function
The <a href="../modules/Input.html#">Input</a> constructor
<h3>Parameters:</h3>
@ -241,9 +241,8 @@
Text node what will be changed on user input. You can pass text component instead of text node name <a href="../modules/Text.html#">Text</a>
</li>
<li><span class="parameter">keyboard_type</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>
Gui keyboard type for input field
(<em>optional</em>)
</li>
</ul>
@ -422,7 +421,7 @@
<h3>Fields:</h3>
<ul>
<li><span class="parameter">IS_LONGTAP_ERASE</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
Is long tap will erase current input data
(<em>default</em> false)
</li>
@ -432,12 +431,12 @@
(<em>default</em> *)
</li>
<li><span class="parameter">IS_UNSELECT_ON_RESELECT</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
If true, call unselect on select selected input
(<em>default</em> false)
</li>
<li><span class="parameter">NO_CONSUME_INPUT_WHILE_SELECTED</span>
<span class="types"><span class="type">bool</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)
(<em>default</em> false)
</li>
@ -519,7 +518,7 @@
<ul>
<li><span class="parameter">is_empty</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
</li>
</ul>
@ -539,7 +538,7 @@
<ul>
<li><span class="parameter">is_selected</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
</li>
</ul>

View File

@ -89,11 +89,11 @@
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#format">format(self[, a[, b[, c[, d[, e[, f[, g]]]]]]])</a></td>
<td class="name" nowrap><a href="#format">format(self, a, b, c, d, e, f, g)</a></td>
<td class="summary">Format string with new text params on localized text</td>
</tr>
<tr>
<td class="name" nowrap><a href="#init">init(self, node, locale_id[, adjust_type=downscale])</a></td>
<td class="name" nowrap><a href="#init">init(self, node[, locale_id=node_text[, adjust_type=downscale]])</a></td>
<td class="summary">The <a href="../modules/LangText.html#">LangText</a> constructor</td>
</tr>
<tr>
@ -101,12 +101,16 @@
<td class="summary">Setup raw text to lang_text component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#translate">translate(self, locale_id[, a[, b[, c[, d[, e[, f[, g]]]]]]])</a></td>
<td class="name" nowrap><a href="#translate">translate(self, locale_id, a, b, c, d, e, f, g)</a></td>
<td class="summary">Translate the text by locale_id</td>
</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#node">node</a></td>
<td class="summary">Text node</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_change">on_change</a></td>
<td class="summary">On change text callback</td>
@ -126,7 +130,7 @@
<dl class="function">
<dt>
<a name = "format"></a>
<strong>format(self[, a[, b[, c[, d[, e[, f[, g]]]]]]])</strong>
<strong>format(self, a, b, c, d, e, f, g)</strong>
</dt>
<dd>
Format string with new text params on localized text
@ -139,39 +143,32 @@
<a href="../modules/LangText.html#">LangText</a>
</li>
<li><span class="parameter">a</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>
Optional param to string.format
(<em>optional</em>)
</li>
<li><span class="parameter">b</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>
Optional param to string.format
(<em>optional</em>)
</li>
<li><span class="parameter">c</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>
Optional param to string.format
(<em>optional</em>)
</li>
<li><span class="parameter">d</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>
Optional param to string.format
(<em>optional</em>)
</li>
<li><span class="parameter">e</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>
Optional param to string.format
(<em>optional</em>)
</li>
<li><span class="parameter">f</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>
Optional param to string.format
(<em>optional</em>)
</li>
<li><span class="parameter">g</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>
Optional param to string.format
(<em>optional</em>)
</li>
</ul>
@ -188,7 +185,7 @@
</dd>
<dt>
<a name = "init"></a>
<strong>init(self, node, locale_id[, adjust_type=downscale])</strong>
<strong>init(self, node[, locale_id=node_text[, adjust_type=downscale]])</strong>
</dt>
<dd>
The <a href="../modules/LangText.html#">LangText</a> constructor
@ -201,12 +198,13 @@
<a href="../modules/LangText.html#">LangText</a>
</li>
<li><span class="parameter">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>
Node name or GUI Text Node itself
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <a class="type" href="../modules/LangText.html#node">node</a></span>
The node_id or gui.get_node(node_id)
</li>
<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>
Default locale id or text from node as default
(<em>default</em> node_text)
</li>
<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>
@ -253,7 +251,7 @@
</dd>
<dt>
<a name = "translate"></a>
<strong>translate(self, locale_id[, a[, b[, c[, d[, e[, f[, g]]]]]]])</strong>
<strong>translate(self, locale_id, a, b, c, d, e, f, g)</strong>
</dt>
<dd>
Translate the text by locale_id
@ -270,39 +268,32 @@
Locale id
</li>
<li><span class="parameter">a</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>
Optional param to string.format
(<em>optional</em>)
</li>
<li><span class="parameter">b</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>
Optional param to string.format
(<em>optional</em>)
</li>
<li><span class="parameter">c</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>
Optional param to string.format
(<em>optional</em>)
</li>
<li><span class="parameter">d</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>
Optional param to string.format
(<em>optional</em>)
</li>
<li><span class="parameter">e</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>
Optional param to string.format
(<em>optional</em>)
</li>
<li><span class="parameter">f</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>
Optional param to string.format
(<em>optional</em>)
</li>
<li><span class="parameter">g</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>
Optional param to string.format
(<em>optional</em>)
</li>
</ul>
@ -321,6 +312,26 @@
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "node"></a>
<strong>node</strong>
</dt>
<dd>
Text node
<ul>
<li><span class="parameter">node</span>
<span class="types"><a class="type" href="../modules/LangText.html#node">node</a></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_change"></a>
<strong>on_change</strong>

View File

@ -82,7 +82,7 @@
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#fit_into_node">fit_into_node(self[, node])</a></td>
<td class="name" nowrap><a href="#fit_into_node">fit_into_node(self, node)</a></td>
<td class="summary">Set node for layout node to fit inside it.</td>
</tr>
<tr>
@ -94,8 +94,8 @@
<td class="summary">Set current size for layout node to fit inside it</td>
</tr>
<tr>
<td class="name" nowrap><a href="#init">init(self, node, mode[, on_size_changed_callback])</a></td>
<td class="summary">Component init function</td>
<td class="name" nowrap><a href="#init">init(self, node, mode, on_size_changed_callback)</a></td>
<td class="summary">The <a href="../modules/Layout.html#">Layout</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_max_gui_upscale">set_max_gui_upscale(self, max_gui_upscale)</a></td>
@ -143,7 +143,7 @@
<dl class="function">
<dt>
<a name = "fit_into_node"></a>
<strong>fit_into_node(self[, node])</strong>
<strong>fit_into_node(self, node)</strong>
</dt>
<dd>
Set node for layout node to fit inside it. Pass nil to reset
@ -156,9 +156,8 @@
<a href="../modules/Layout.html#">Layout</a>
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">Node</span></span>
<span class="types"><a class="type" href="../modules/Layout.html#node">node</a> or <span class="type">nil</span></span>
(<em>optional</em>)
</li>
</ul>
@ -233,10 +232,10 @@
</dd>
<dt>
<a name = "init"></a>
<strong>init(self, node, mode[, on_size_changed_callback])</strong>
<strong>init(self, node, mode, on_size_changed_callback)</strong>
</dt>
<dd>
Component init function
The <a href="../modules/Layout.html#">Layout</a> constructor
<h3>Parameters:</h3>
@ -254,9 +253,8 @@
The layout mode (from const.LAYOUT_MODE)
</li>
<li><span class="parameter">on_size_changed_callback</span>
<span class="types"><span class="type">function</span></span>
<span class="types"><span class="type">function</span> or <span class="type">nil</span></span>
The callback on window resize
(<em>optional</em>)
</li>
</ul>

View File

@ -84,7 +84,7 @@
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(self, callback, template, nodes)</a></td>
<td class="summary">Component init function</td>
<td class="summary">The <a href="../modules/PinKnob.html#">PinKnob</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_angle">set_angle(self, cur_value, min, max)</a></td>
@ -123,7 +123,7 @@
<strong>init(self, callback, template, nodes)</strong>
</dt>
<dd>
Component init function
The <a href="../modules/PinKnob.html#">PinKnob</a> constructor
<h3>Parameters:</h3>
@ -256,7 +256,7 @@
<ul>
<li><span class="parameter">is_drag</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
</li>
</ul>

View File

@ -104,7 +104,7 @@
</tr>
<tr>
<td class="name" nowrap><a href="#init">init(self, node, key[, init_value=1])</a></td>
<td class="summary"><a href="../modules/Progress.html#">Progress</a> constructor</td>
<td class="summary">The <a href="../modules/Progress.html#">Progress</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_max_size">set_max_size(self, max_size)</a></td>
@ -119,7 +119,7 @@
<td class="summary">Instant fill progress bar to value</td>
</tr>
<tr>
<td class="name" nowrap><a href="#to">to(self, to[, callback])</a></td>
<td class="name" nowrap><a href="#to">to(self, to, callback)</a></td>
<td class="summary">Start animation of a progress bar</td>
</tr>
</table>
@ -237,7 +237,7 @@
<strong>init(self, node, key[, init_value=1])</strong>
</dt>
<dd>
<a href="../modules/Progress.html#">Progress</a> constructor
The <a href="../modules/Progress.html#">Progress</a> constructor
<h3>Parameters:</h3>
@ -357,7 +357,7 @@
</dd>
<dt>
<a name = "to"></a>
<strong>to(self, to[, callback])</strong>
<strong>to(self, to, callback)</strong>
</dt>
<dd>
Start animation of a progress bar
@ -374,9 +374,8 @@
value between 0..1
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
<span class="types"><span class="type">function</span> or <span class="type">nil</span></span>
Callback on animation ends
(<em>optional</em>)
</li>
</ul>

View File

@ -87,7 +87,7 @@
</tr>
<tr>
<td class="name" nowrap><a href="#init">init(self, nodes, callback[, click_nodes=node])</a></td>
<td class="summary">Component init function</td>
<td class="summary">The <a href="../modules/RadioGroup.html#">RadioGroup</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_state">set_state(self, index, is_instant)</a></td>
@ -145,7 +145,7 @@
<strong>init(self, nodes, callback[, click_nodes=node])</strong>
</dt>
<dd>
Component init function
The <a href="../modules/RadioGroup.html#">RadioGroup</a> constructor
<h3>Parameters:</h3>
@ -193,7 +193,7 @@
Index in radio group
</li>
<li><span class="parameter">is_instant</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 is instant state change
</li>
</ul>

View File

@ -82,9 +82,17 @@
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#get_text">get_text(self)</a></td>
<td class="summary">GSet input field text</td>
</tr>
<tr>
<td class="name" nowrap><a href="#init">init(self, template, nodes)</a></td>
<td class="summary">Component init function</td>
<td class="summary">The <a href="../modules/RichInput.html#">RichInput</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_allowed_characters">set_allowed_characters(self, characters)</a></td>
<td class="summary">Set allowed charaters for input field.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_placeholder">set_placeholder(self, placeholder_text)</a></td>
@ -109,6 +117,10 @@
<td class="name" nowrap><a href="#placeholder">placeholder</a></td>
<td class="summary">On input field text change to max length string callback(self, input_text)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#root">root</a></td>
<td class="summary">Root node</td>
</tr>
</table>
<br/>
@ -118,12 +130,39 @@
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "get_text"></a>
<strong>get_text(self)</strong>
</dt>
<dd>
GSet input field text
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">RichInput</span></span>
<a href="../modules/RichInput.html#">RichInput</a>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
Current input text
</ol>
</dd>
<dt>
<a name = "init"></a>
<strong>init(self, template, nodes)</strong>
</dt>
<dd>
Component init function
The <a href="../modules/RichInput.html#">RichInput</a> constructor
<h3>Parameters:</h3>
@ -146,6 +185,39 @@
</dd>
<dt>
<a name = "set_allowed_characters"></a>
<strong>set_allowed_characters(self, characters)</strong>
</dt>
<dd>
Set allowed charaters for input field.
See: https://defold.com/ref/stable/string/
ex: [%a%d] for alpha and numeric
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">RichInput</span></span>
<a href="../modules/RichInput.html#">RichInput</a>
</li>
<li><span class="parameter">characters</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
Regulax exp. for validate user input
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">RichInput</span></span>
Current instance
</ol>
</dd>
<dt>
<a name = "set_placeholder"></a>
@ -162,11 +234,17 @@
<a href="../modules/RichInput.html#">RichInput</a>
</li>
<li><span class="parameter">placeholder_text</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 placeholder text
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">RichInput</span></span>
Current instance
</ol>
@ -255,6 +333,26 @@
</dd>
<dt>
<a name = "root"></a>
<strong>root</strong>
</dt>
<dd>
Root node
<ul>
<li><span class="parameter">root</span>
<span class="types"><span class="type">node</span></span>
</li>
</ul>
</dd>
</dl>

View File

@ -34,6 +34,7 @@
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
@ -163,7 +164,7 @@ type druid.rich_text.metrics = {
</tr>
<tr>
<td class="name" nowrap><a href="#init">init(self, template, nodes)</a></td>
<td class="summary">Rich Text component constructor</td>
<td class="summary">The <a href="../modules/RichText.html#">RichText</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_text">set_text(self, text)</a></td>
@ -181,6 +182,13 @@ type druid.rich_text.metrics = {
<td class="summary">Component style params.</td>
</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#druid">druid</a></td>
<td class="summary">The component druid instance</td>
</tr>
</table>
<br/>
<br/>
@ -248,7 +256,7 @@ type druid.rich_text.metrics = {
<strong>init(self, template, nodes)</strong>
</dt>
<dd>
Rich Text component constructor
The <a href="../modules/RichText.html#">RichText</a> constructor
<h3>Parameters:</h3>
@ -415,6 +423,30 @@ Words &lt;nobr&gt;inside tag&lt;/nobr&gt; won't <span class="keyword">break</spa
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "druid"></a>
<strong>druid</strong>
</dt>
<dd>
The component druid instance
<ul>
<li><span class="parameter">druid</span>
<span class="types"><span class="type">DruidInstance</span></span>
<a href="../modules/DruidInstance.html#">DruidInstance</a>
</li>
</ul>
</dd>
</dl>

View File

@ -117,7 +117,7 @@
</tr>
<tr>
<td class="name" nowrap><a href="#init">init(self, view_node, content_node)</a></td>
<td class="summary"><a href="../modules/Scroll.html#">Scroll</a> constructor</td>
<td class="summary">The <a href="../modules/Scroll.html#">Scroll</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_inert">is_inert(self)</a></td>
@ -128,15 +128,15 @@
<td class="summary">Check node if it visible now on scroll.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#scroll_to">scroll_to(self, point[, is_instant])</a></td>
<td class="name" nowrap><a href="#scroll_to">scroll_to(self, point, is_instant)</a></td>
<td class="summary">Start scroll to target point.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#scroll_to_index">scroll_to_index(self, index[, skip_cb])</a></td>
<td class="name" nowrap><a href="#scroll_to_index">scroll_to_index(self, index, skip_cb)</a></td>
<td class="summary">Scroll to item in scroll by point index.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#scroll_to_percent">scroll_to_percent(self, percent[, is_instant])</a></td>
<td class="name" nowrap><a href="#scroll_to_percent">scroll_to_percent(self, percent, is_instant)</a></td>
<td class="summary">Start scroll to target scroll percent</td>
</tr>
<tr>
@ -144,7 +144,7 @@
<td class="summary">Strict drag scroll area.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_extra_stretch_size">set_extra_stretch_size(self[, stretch_size=0])</a></td>
<td class="name" nowrap><a href="#set_extra_stretch_size">set_extra_stretch_size(self, stretch_size)</a></td>
<td class="summary">Set extra size for scroll stretching.</td>
</tr>
<tr>
@ -202,10 +202,6 @@
<td class="summary">Flag, if scroll now animating by gui.animate</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_inert">is_inert</a></td>
<td class="summary">Flag, if scroll now moving by inertion</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_point_scroll">on_point_scroll</a></td>
<td class="summary">On scroll_to_index function callback(self, index, point)</td>
</tr>
@ -334,7 +330,7 @@
<strong>init(self, view_node, content_node)</strong>
</dt>
<dd>
<a href="../modules/Scroll.html#">Scroll</a> constructor
The <a href="../modules/Scroll.html#">Scroll</a> constructor
<h3>Parameters:</h3>
@ -377,8 +373,8 @@
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
If scroll have inertion
<span class="types"><span class="type">boolean</span></span>
@If scroll have inertion
</ol>
@ -419,7 +415,7 @@
</dd>
<dt>
<a name = "scroll_to"></a>
<strong>scroll_to(self, point[, is_instant])</strong>
<strong>scroll_to(self, point, is_instant)</strong>
</dt>
<dd>
Start scroll to target point.
@ -436,9 +432,8 @@
Target point
</li>
<li><span class="parameter">is_instant</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
Instant scroll flag
(<em>optional</em>)
</li>
</ul>
@ -454,7 +449,7 @@
</dd>
<dt>
<a name = "scroll_to_index"></a>
<strong>scroll_to_index(self, index[, skip_cb])</strong>
<strong>scroll_to_index(self, index, skip_cb)</strong>
</dt>
<dd>
Scroll to item in scroll by point index.
@ -471,9 +466,8 @@
Point index
</li>
<li><span class="parameter">skip_cb</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
If true, skip the point callback
(<em>optional</em>)
</li>
</ul>
@ -484,7 +478,7 @@
</dd>
<dt>
<a name = "scroll_to_percent"></a>
<strong>scroll_to_percent(self, percent[, is_instant])</strong>
<strong>scroll_to_percent(self, percent, is_instant)</strong>
</dt>
<dd>
Start scroll to target scroll percent
@ -501,9 +495,8 @@
target percent
</li>
<li><span class="parameter">is_instant</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
instant scroll flag
(<em>optional</em>)
</li>
</ul>
@ -544,7 +537,7 @@
</dd>
<dt>
<a name = "set_extra_stretch_size"></a>
<strong>set_extra_stretch_size(self[, stretch_size=0])</strong>
<strong>set_extra_stretch_size(self, stretch_size)</strong>
</dt>
<dd>
Set extra size for scroll stretching.
@ -558,9 +551,8 @@
<a href="../modules/Scroll.html#">Scroll</a>
</li>
<li><span class="parameter">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>
Size in pixels of additional scroll area
(<em>default</em> 0)
</li>
</ul>
@ -590,7 +582,7 @@
<a href="../modules/Scroll.html#">Scroll</a>
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
True, if horizontal scroll is enabled
</li>
</ul>
@ -623,7 +615,7 @@
<a href="../modules/Scroll.html#">Scroll</a>
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
Inert scroll state
</li>
</ul>
@ -722,7 +714,7 @@
<a href="../modules/Scroll.html#">Scroll</a>
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
True, if vertical scroll is enabled
</li>
</ul>
@ -795,22 +787,22 @@
(<em>default</em> 0)
</li>
<li><span class="parameter">SMALL_CONTENT_SCROLL</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
If true, content node with size less than view node size can be scrolled
(<em>default</em> false)
</li>
<li><span class="parameter">WHEEL_SCROLL_SPEED</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
The scroll speed via mouse wheel scroll or touchpad. Set to 0 to disable wheel scrolling
(<em>default</em> 0)
</li>
<li><span class="parameter">WHEEL_SCROLL_INVERTED</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
If true, invert direction for touchpad and mouse wheel scroll
(<em>default</em> false)
</li>
<li><span class="parameter">WHEEL_SCROLL_BY_INERTION</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
If true, wheel will add inertion to scroll. Direct set position otherwise.
(<em>default</em> false)
</li>
@ -935,27 +927,7 @@
<ul>
<li><span class="parameter">is_animate</span>
<span class="types"><span class="type">bool</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "is_inert"></a>
<strong>is_inert</strong>
</dt>
<dd>
Flag, if scroll now moving by inertion
<ul>
<li><span class="parameter">is_inert</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
</li>
</ul>

View File

@ -82,11 +82,11 @@
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(self, node, end_pos[, callback])</a></td>
<td class="summary">Component init function</td>
<td class="name" nowrap><a href="#init">init(self, node, end_pos, callback)</a></td>
<td class="summary">The <a href="../modules/Slider.html#">Slider</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set">set(self, value[, is_silent])</a></td>
<td class="name" nowrap><a href="#set">set(self, value, is_silent)</a></td>
<td class="summary">Set value for slider</td>
</tr>
<tr>
@ -147,10 +147,10 @@
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(self, node, end_pos[, callback])</strong>
<strong>init(self, node, end_pos, callback)</strong>
</dt>
<dd>
Component init function
The <a href="../modules/Slider.html#">Slider</a> constructor
<h3>Parameters:</h3>
@ -168,9 +168,8 @@
The end position of slider
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
<span class="types"><span class="type">function</span> or <span class="type">nil</span></span>
On slider change callback
(<em>optional</em>)
</li>
</ul>
@ -181,7 +180,7 @@
</dd>
<dt>
<a name = "set"></a>
<strong>set(self, value[, is_silent])</strong>
<strong>set(self, value, is_silent)</strong>
</dt>
<dd>
Set value for slider
@ -198,9 +197,8 @@
Value from 0 to 1
</li>
<li><span class="parameter">is_silent</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
Don't trigger event if true
(<em>optional</em>)
</li>
</ul>
@ -227,7 +225,7 @@
<a href="../modules/Slider.html#">Slider</a>
</li>
<li><span class="parameter">input_node</span>
<span class="types"><span class="type">Node</span></span>
<span class="types"><a class="type" href="../modules/Slider.html#node">node</a></span>
</li>
</ul>
@ -333,7 +331,7 @@
<ul>
<li><span class="parameter">is_drag</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
</li>
</ul>

View File

@ -102,7 +102,7 @@
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#add">add(self, item[, index[, shift_policy=SHIFT.RIGHT[, is_instant=false]]])</a></td>
<td class="name" nowrap><a href="#add">add(self, item, index, shift_policy, is_instant)</a></td>
<td class="summary">Add new item to the grid</td>
</tr>
<tr>
@ -142,7 +142,7 @@
<td class="summary">The <a href="../modules/StaticGrid.html#">StaticGrid</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#remove">remove(self, index[, shift_policy=SHIFT.RIGHT[, is_instant=false]])</a></td>
<td class="name" nowrap><a href="#remove">remove(self, index, shift_policy, is_instant)</a></td>
<td class="summary">Remove the item from the grid.</td>
</tr>
<tr>
@ -230,7 +230,7 @@
<dl class="function">
<dt>
<a name = "add"></a>
<strong>add(self, item[, index[, shift_policy=SHIFT.RIGHT[, is_instant=false]]])</strong>
<strong>add(self, item, index, shift_policy, is_instant)</strong>
</dt>
<dd>
Add new item to the grid
@ -244,22 +244,19 @@
</li>
<li><span class="parameter">item</span>
<span class="types"><span class="type">node</span></span>
Gui node
GUI node
</li>
<li><span class="parameter">index</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 item position. By default add as last item
(<em>optional</em>)
</li>
<li><span class="parameter">shift_policy</span>
<span class="types"><span class="type">number</span></span>
How shift nodes, if required. See const.SHIFT
(<em>default</em> SHIFT.RIGHT)
<span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
How shift nodes, if required. Default: const.SHIFT.RIGHT
</li>
<li><span class="parameter">is_instant</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, update node positions instantly
(<em>default</em> false)
</li>
</ul>
@ -463,7 +460,7 @@
<ol>
<span class="types"><span class="type">vector3</span></span>
Node position
@Node position
</ol>
@ -512,7 +509,7 @@
<a href="../modules/StaticGrid.html#">StaticGrid</a>
</li>
<li><span class="parameter">parent</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> or <span class="type">node</span></span>
The GUI Node container, where grid's items will be placed
</li>
<li><span class="parameter">element</span>
@ -533,7 +530,7 @@
</dd>
<dt>
<a name = "remove"></a>
<strong>remove(self, index[, shift_policy=SHIFT.RIGHT[, is_instant=false]])</strong>
<strong>remove(self, index, shift_policy, is_instant)</strong>
</dt>
<dd>
Remove the item from the grid. Note that gui node will be not deleted
@ -550,21 +547,19 @@
The grid node index to remove
</li>
<li><span class="parameter">shift_policy</span>
<span class="types"><span class="type">number</span></span>
How shift nodes, if required. See const.SHIFT
(<em>default</em> SHIFT.RIGHT)
<span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
How shift nodes, if required. Default: const.SHIFT.RIGHT
</li>
<li><span class="parameter">is_instant</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, update node positions instantly
(<em>default</em> false)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Node</span></span>
<span class="types"><span class="type">node</span></span>
The deleted gui node from grid
</ol>
@ -677,12 +672,12 @@
<h3>Fields:</h3>
<ul>
<li><span class="parameter">IS_DYNAMIC_NODE_POSES</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
If true, always center grid content as grid pivot sets
(<em>default</em> false)
</li>
<li><span class="parameter">IS_ALIGN_LAST_ROW</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
If true, always align last row of the grid as grid pivot sets
(<em>default</em> false)
</li>

View File

@ -87,7 +87,7 @@
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(self, node, on_swipe_callback)</a></td>
<td class="summary">Component init function</td>
<td class="summary">The <a href="../modules/Swipe.html#">Swipe</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_click_zone">set_click_zone(self, zone)</a></td>
@ -129,7 +129,7 @@
<strong>init(self, node, on_swipe_callback)</strong>
</dt>
<dd>
Component init function
The <a href="../modules/Swipe.html#">Swipe</a> constructor
<h3>Parameters:</h3>
@ -206,7 +206,7 @@
(<em>default</em> 50)
</li>
<li><span class="parameter">SWIPE_TRIGGER_ON_MOVE</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
If true, trigger on swipe moving, not only release action
(<em>default</em> false)
</li>
@ -231,9 +231,8 @@
<ul>
<li><span class="parameter">click_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> or <span class="type">nil</span></span>
(<em>optional</em>)
</li>
</ul>

View File

@ -105,12 +105,12 @@
<td class="summary">Return current text adjust type</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_text_size">get_text_size(self[, text])</a></td>
<td class="name" nowrap><a href="#get_text_size">get_text_size(self, text)</a></td>
<td class="summary">Calculate text width with font with respect to trailing space</td>
</tr>
<tr>
<td class="name" nowrap><a href="#init">init(self, node[, value[, adjust_type=downscale]])</a></td>
<td class="summary"><a href="../modules/Text.html#">Text</a> constructor</td>
<td class="name" nowrap><a href="#init">init(self, node, value[, adjust_type=downscale])</a></td>
<td class="summary">The <a href="../modules/Text.html#">Text</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_multiline">is_multiline(self)</a></td>
@ -137,7 +137,11 @@
<td class="summary">Set scale</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_text_adjust">set_text_adjust(self[, adjust_type[, minimal_scale]])</a></td>
<td class="name" nowrap><a href="#set_size">set_size(self, size)</a></td>
<td class="summary">Set text area size</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_text_adjust">set_text_adjust(self, adjust_type, minimal_scale)</a></td>
<td class="summary">Set text adjust, refresh the current text visuals, if needed</td>
</tr>
<tr>
@ -163,6 +167,10 @@
<td class="summary">Current text color</td>
</tr>
<tr>
<td class="name" nowrap><a href="#last_value">last_value</a></td>
<td class="summary">The last text value</td>
</tr>
<tr>
<td class="name" nowrap><a href="#node">node</a></td>
<td class="summary">Text node</td>
</tr>
@ -242,7 +250,7 @@
</dd>
<dt>
<a name = "get_text_size"></a>
<strong>get_text_size(self[, text])</strong>
<strong>get_text_size(self, text)</strong>
</dt>
<dd>
Calculate text width with font with respect to trailing space
@ -255,9 +263,8 @@
<a href="../modules/Text.html#">Text</a>
</li>
<li><span class="parameter">text</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>
(<em>optional</em>)
</li>
</ul>
@ -277,10 +284,10 @@
</dd>
<dt>
<a name = "init"></a>
<strong>init(self, node[, value[, adjust_type=downscale]])</strong>
<strong>init(self, node, value[, adjust_type=downscale])</strong>
</dt>
<dd>
<a href="../modules/Text.html#">Text</a> constructor
The <a href="../modules/Text.html#">Text</a> constructor
<h3>Parameters:</h3>
@ -294,9 +301,8 @@
Node name or GUI Text Node itself
</li>
<li><span class="parameter">value</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>
Initial text. Default value is node text from GUI scene.
(<em>optional</em>)
</li>
<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>
@ -329,7 +335,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span></span>
Is text node with line break
</ol>
@ -445,8 +451,8 @@
<a href="../modules/Text.html#">Text</a>
</li>
<li><span class="parameter">pivot</span>
<span class="types"><span class="type">gui.pivot</span></span>
Gui pivot constant
<span class="types"><span class="type">number</span></span>
The gui.PIVOT_* constant
</li>
</ul>
@ -491,10 +497,41 @@
</dd>
<dt>
<a name = "set_size"></a>
<strong>set_size(self, size)</strong>
</dt>
<dd>
Set text area size
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Text</span></span>
<a href="../modules/Text.html#">Text</a>
</li>
<li><span class="parameter">size</span>
<span class="types"><span class="type">vector3</span></span>
The new text area size
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Text</span></span>
Current text instance
</ol>
</dd>
<dt>
<a name = "set_text_adjust"></a>
<strong>set_text_adjust(self[, adjust_type[, minimal_scale]])</strong>
<strong>set_text_adjust(self, adjust_type, minimal_scale)</strong>
</dt>
<dd>
Set text adjust, refresh the current text visuals, if needed
@ -507,14 +544,12 @@
<a href="../modules/Text.html#">Text</a>
</li>
<li><span class="parameter">adjust_type</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>
See const.TEXT_ADJUST. If pass nil - use current adjust type
(<em>optional</em>)
</li>
<li><span class="parameter">minimal_scale</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>
If pass nil - not use minimal scale
(<em>optional</em>)
</li>
</ul>
@ -636,6 +671,26 @@
</dd>
<dt>
<a name = "last_value"></a>
<strong>last_value</strong>
</dt>
<dd>
The last text value
<ul>
<li><span class="parameter">last_value</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
</li>
</ul>
</dd>
<dt>
<a name = "node"></a>

View File

@ -84,8 +84,8 @@
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(self, node, seconds_from[, seconds_to=0[, callback]])</a></td>
<td class="summary">Component init function</td>
<td class="name" nowrap><a href="#init">init(self, node, seconds_from, seconds_to, callback)</a></td>
<td class="summary">The <a href="../modules/Timer.html#">Timer</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_interval">set_interval(self, from, to)</a></td>
@ -141,10 +141,10 @@
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(self, node, seconds_from[, seconds_to=0[, callback]])</strong>
<strong>init(self, node, seconds_from, seconds_to, callback)</strong>
</dt>
<dd>
Component init function
The <a href="../modules/Timer.html#">Timer</a> constructor
<h3>Parameters:</h3>
@ -162,14 +162,12 @@
Start timer value in seconds
</li>
<li><span class="parameter">seconds_to</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>
End timer value in seconds
(<em>default</em> 0)
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
<span class="types"><span class="type">function</span> or <span class="type">nil</span></span>
Function on timer end
(<em>optional</em>)
</li>
</ul>
@ -222,7 +220,7 @@
<a href="../modules/Timer.html#">Timer</a>
</li>
<li><span class="parameter">is_on</span>
<span class="types"><span class="type">bool</span></span>
<span class="types"><span class="type">boolean</span> or <span class="type">nil</span></span>
Timer enable state
</li>
</ul>

File diff suppressed because it is too large Load Diff

View File

@ -45,8 +45,8 @@ local BackHandler = component.create("back_handler")
--- The @{BackHandler} constructor
-- @tparam BackHandler self @{BackHandler}
-- @tparam callback callback On back button
-- @tparam[opt] any custom_args Button events custom arguments
-- @tparam function callback @The callback(self, custom_args) to call on back event
-- @tparam any|nil custom_args Button events custom arguments
-- @local
function BackHandler.init(self, callback, custom_args)
self.params = custom_args

View File

@ -30,7 +30,7 @@ local component = require("druid.component")
local Blocker = component.create("blocker")
--- @{Blocker} constructor
--- The @{Blocker} constructor
-- @tparam Blocker self @{Blocker}
-- @tparam node node Gui node
function Blocker.init(self, node)
@ -51,7 +51,7 @@ function Blocker.on_input(self, action_id, action)
return false
end
if not self:is_enabled(self.node) then
if not self:is_enabled() then
return false
end
@ -71,7 +71,7 @@ end
--
-- Don't change node enabled state itself.
-- @tparam Blocker self @{Blocker}
-- @tparam bool state Enabled state
-- @tparam boolean|nil state Enabled state
function Blocker.set_enabled(self, state)
self._is_enabled = state
end
@ -79,7 +79,7 @@ end
--- Return blocker enabled state
-- @tparam Blocker self @{Blocker}
-- @treturn bool True, if blocker is enabled
-- @treturn boolean @True, if blocker is enabled
function Blocker.is_enabled(self)
return self._is_enabled
end

View File

@ -27,7 +27,7 @@
-- print("Also the button component is passed in callback params")
-- end
--
-- local custom_args = "Any variable to pass inside callback"
-- local custom_args = "any variable to pass inside callback"
-- local button = self.druid:new_button("button_name", on_button_click, custom_args)
--
-- @module Button
@ -114,7 +114,7 @@
-- @tfield DruidEvent on_pressed @{DruidEvent}
--- Button trigger node
-- @tfield Node node
-- @tfield node node
---The GUI node id from button node
-- @tfield hash node_id
@ -257,15 +257,15 @@ end
--- Component style params.
-- You can override this component styles params in Druid styles table
-- or create your own style
-- @table style
-- @tfield[opt=0.4] number LONGTAP_TIME Minimum time to trigger on_hold_callback
-- @tfield[opt=0.8] number AUTOHOLD_TRIGGER Maximum hold time to trigger button release while holding
-- @tfield[opt=0.4] number DOUBLETAP_TIME Time between double taps
-- @tfield function on_click (self, node)
-- @tfield function on_click_disabled (self, node)
-- @tfield function on_hover (self, node, hover_state)
-- @tfield function on_mouse_hover (self, node, hover_state)
-- @tfield function on_set_enabled (self, node, enabled_state)
-- @tfield function on_click function(self, node)
-- @tfield function on_click_disabled function(self, node)
-- @tfield function on_hover function(self, node, hover_state)
-- @tfield function on_mouse_hover function(self, node, hover_state)
-- @tfield function on_set_enabled function(self, node, enabled_state)
-- @table style
function Button.on_style_change(self, style)
self.style = {}
self.style.LONGTAP_TIME = style.LONGTAP_TIME or 0.4
@ -282,10 +282,10 @@ end
--- The @{Button} constructor
-- @tparam Button self @{Button}
-- @tparam string|Node node Node name or GUI Node itself
-- @tparam string|node node The node_id or gui.get_node(node_id)
-- @tparam function callback On click button callback
-- @tparam[opt] any custom_args Button events custom arguments
-- @tparam[opt] string|Node anim_node Node to animate instead of trigger node.
-- @tparam any|nil custom_args Button events custom arguments
-- @tparam string|node|nil anim_node Node to animate instead of trigger node.
function Button.init(self, node, callback, custom_args, anim_node)
self.druid = self:get_druid()
self.node = self:get_node(node)
@ -447,7 +447,7 @@ end
-- The style.on_set_enabled will be triggered.
-- Disabled button is not clickable.
-- @tparam Button self @{Button}
-- @tparam bool state Enabled state
-- @tparam boolean|nil state Enabled state
-- @treturn Button Current button instance
-- @usage
-- button:set_enabled(false)
@ -465,7 +465,7 @@ end
--
-- By default all Buttons is enabled on creating.
-- @tparam Button self @{Button}
-- @treturn bool True, if button is enabled now, False overwise
-- @treturn boolean @True, if button is enabled now, False overwise
-- @usage
-- local is_enabled = button:is_enabled()
function Button.is_enabled(self)
@ -478,7 +478,7 @@ end
--
-- This functions calls automatically if you don't disable it in game.project: druid.no_stencil_check
-- @tparam Button self @{Button}
-- @tparam node zone Gui node
-- @tparam node|nil zone Gui node
-- @treturn Button Current button instance
-- @usage
-- button:set_click_zone("stencil_node")
@ -515,8 +515,8 @@ end
--- Set function for additional check for button click availability
-- @tparam Button self
-- @tparam[opt] function check_function Should return true or false. If true - button can be pressed.
-- @tparam[opt] function failure_callback Function will be called on button click, if check function return false
-- @tparam function|nil check_function Should return true or false. If true - button can be pressed.
-- @tparam function|nil failure_callback Function will be called on button click, if check function return false
-- @treturn Button Current button instance
function Button.set_check_function(self, check_function, failure_callback)
self._check_function = check_function
@ -531,7 +531,7 @@ end
--
-- If the game is not HTML, html mode will be not enabled
-- @tparam Button self
-- @tparam[opt] boolean is_web_mode If true - button will be called inside html5 callback
-- @tparam boolean|nil is_web_mode If true - button will be called inside html5 callback
-- @treturn Button Current button instance
-- @usage
-- button:set_web_user_interaction(true)

View File

@ -26,16 +26,16 @@
-- @tfield DruidEvent on_drag_end @{DruidEvent}
--- Is component now touching
-- @tfield bool is_touch
-- @tfield boolean is_touch
--- Is component now dragging
-- @tfield bool is_drag
-- @tfield boolean is_drag
--- Is drag component process vertical dragging. Default - true
-- @tfield bool can_x
-- @tfield boolean can_x
--- Is drag component process horizontal. Default - true
-- @tfield bool can_y
-- @tfield boolean can_y
--- Current touch x position
-- @tfield number x
@ -170,7 +170,7 @@ function Drag.on_style_change(self, style)
end
--- Drag component constructor
--- The @{Drag} constructor
-- @tparam Drag self @{Drag}
-- @tparam node node GUI node to detect dragging
-- @tparam function on_drag_callback Callback for on_drag_event(self, dx, dy)
@ -313,7 +313,7 @@ end
--- Set Drag input enabled or disabled
-- @tparam Drag self @{Drag}
-- @tparam bool is_enabled
-- @tparam boolean|nil is_enabled
function Drag.set_enabled(self, is_enabled)
self._is_enabled = is_enabled
end
@ -321,7 +321,7 @@ end
--- Check if Drag component is enabled
-- @tparam Drag self @{Drag}
-- @treturn bool
-- @treturn boolean
function Drag.is_enabled(self)
return self._is_enabled
end

View File

@ -21,7 +21,7 @@ local component = require("druid.component")
local Hover = component.create("hover")
--- Component init function
--- The @{Hover} constructor
-- @tparam Hover self @{Hover}
-- @tparam node node Gui node
-- @tparam function on_hover_callback Hover callback
@ -89,7 +89,7 @@ end
--- Set hover state
-- @tparam Hover self @{Hover}
-- @tparam bool state The hover state
-- @tparam boolean|nil state The hover state
function Hover.set_hover(self, state)
if self._is_hovered ~= state then
self._is_hovered = state
@ -100,7 +100,7 @@ end
--- Return current hover state. True if touch action was on the node at current time
-- @tparam Hover self @{Hover}
-- @treturn bool The current hovered state
-- @treturn boolean The current hovered state
function Hover.is_hovered(self)
return self._is_hovered
end
@ -108,7 +108,7 @@ end
--- Set mouse hover state
-- @tparam Hover self @{Hover}
-- @tparam bool state The mouse hover state
-- @tparam boolean|nil state The mouse hover state
function Hover.set_mouse_hover(self, state)
if self._is_mouse_hovered ~= state then
self._is_mouse_hovered = state
@ -119,7 +119,7 @@ end
--- Return current hover state. True if nil action_id (usually desktop mouse) was on the node at current time
-- @tparam Hover self @{Hover}
-- @treturn bool The current hovered state
-- @treturn boolean The current hovered state
function Hover.is_mouse_hovered(self)
return self._is_mouse_hovered
end
@ -138,7 +138,7 @@ end
-- If hover is not enabled, it will not generate
-- any hover events
-- @tparam Hover self @{Hover}
-- @tparam bool state The hover enabled state
-- @tparam boolean|nil state The hover enabled state
function Hover.set_enabled(self, state)
self._is_enabled = state
@ -155,7 +155,7 @@ end
--- Return current hover enabled state
-- @tparam Hover self @{Hover}
-- @treturn bool The hover enabled state
-- @treturn boolean The hover enabled state
function Hover.is_enabled(self)
return self._is_enabled
end

View File

@ -53,9 +53,6 @@
--- Scroll content node
-- @tfield node content_node
--- Flag, if scroll now moving by inertion
-- @tfield bool is_inert
--- Current inert speed
-- @tfield vector3 inertion
@ -78,7 +75,7 @@
-- @tfield[opt] number selected
--- Flag, if scroll now animating by gui.animate
-- @tfield bool is_animate
-- @tfield boolean is_animate
---
@ -131,10 +128,10 @@ end
-- @tfield[opt=0.35] number BACK_SPEED Scroll back returning lerp speed
-- @tfield[opt=0.2] number ANIM_SPEED Scroll gui.animation speed for scroll_to function
-- @tfield[opt=0] number EXTRA_STRETCH_SIZE extra size in pixels outside of scroll (stretch effect)
-- @tfield[opt=false] bool SMALL_CONTENT_SCROLL If true, content node with size less than view node size can be scrolled
-- @tfield[opt=0] bool WHEEL_SCROLL_SPEED The scroll speed via mouse wheel scroll or touchpad. Set to 0 to disable wheel scrolling
-- @tfield[opt=false] bool WHEEL_SCROLL_INVERTED If true, invert direction for touchpad and mouse wheel scroll
-- @tfield[opt=false] bool WHEEL_SCROLL_BY_INERTION If true, wheel will add inertion to scroll. Direct set position otherwise.
-- @tfield[opt=false] boolean SMALL_CONTENT_SCROLL If true, content node with size less than view node size can be scrolled
-- @tfield[opt=0] boolean WHEEL_SCROLL_SPEED The scroll speed via mouse wheel scroll or touchpad. Set to 0 to disable wheel scrolling
-- @tfield[opt=false] boolean WHEEL_SCROLL_INVERTED If true, invert direction for touchpad and mouse wheel scroll
-- @tfield[opt=false] boolean WHEEL_SCROLL_BY_INERTION If true, wheel will add inertion to scroll. Direct set position otherwise.
function Scroll.on_style_change(self, style)
self.style = {}
self.style.EXTRA_STRETCH_SIZE = style.EXTRA_STRETCH_SIZE or 0
@ -158,7 +155,7 @@ function Scroll.on_style_change(self, style)
end
--- @{Scroll} constructor
--- The @{Scroll} constructor
-- @tparam Scroll self @{Scroll}
-- @tparam string|node view_node GUI view scroll node
-- @tparam string|node content_node GUI content scroll node
@ -237,7 +234,7 @@ end
--- Start scroll to target point.
-- @tparam Scroll self @{Scroll}
-- @tparam vector3 point Target point
-- @tparam[opt] bool is_instant Instant scroll flag
-- @tparam boolean|nil is_instant Instant scroll flag
-- @usage scroll:scroll_to(vmath.vector3(0, 50, 0))
-- @usage scroll:scroll_to(vmath.vector3(0), true)
function Scroll.scroll_to(self, point, is_instant)
@ -271,7 +268,7 @@ end
--- Scroll to item in scroll by point index.
-- @tparam Scroll self @{Scroll}
-- @tparam number index Point index
-- @tparam[opt] bool skip_cb If true, skip the point callback
-- @tparam boolean|nil skip_cb If true, skip the point callback
function Scroll.scroll_to_index(self, index, skip_cb)
if not self.points then
return
@ -294,7 +291,7 @@ end
--- Start scroll to target scroll percent
-- @tparam Scroll self @{Scroll}
-- @tparam vector3 percent target percent
-- @tparam[opt] bool is_instant instant scroll flag
-- @tparam boolean|nil is_instant instant scroll flag
-- @usage scroll:scroll_to_percent(vmath.vector3(0.5, 0, 0))
function Scroll.scroll_to_percent(self, percent, is_instant)
local border = self.available_pos
@ -342,7 +339,7 @@ end
-- If disabled, scroll through points (if exist)
-- If no points, just simple drag without inertion
-- @tparam Scroll self @{Scroll}
-- @tparam bool state Inert scroll state
-- @tparam boolean|nil state Inert scroll state
-- @treturn druid.scroll Current scroll instance
function Scroll.set_inert(self, state)
self._is_inert = state
@ -353,7 +350,7 @@ end
--- Return if scroll have inertion.
-- @tparam Scroll self @{Scroll}
-- @treturn bool If scroll have inertion
-- @treturn boolean @If scroll have inertion
function Scroll.is_inert(self)
return self._is_inert
end
@ -362,7 +359,7 @@ end
--- Set extra size for scroll stretching.
-- Set 0 to disable stretching effect
-- @tparam Scroll self @{Scroll}
-- @tparam[opt=0] number stretch_size Size in pixels of additional scroll area
-- @tparam number|nil stretch_size Size in pixels of additional scroll area
-- @treturn druid.scroll Current scroll instance
function Scroll.set_extra_stretch_size(self, stretch_size)
self.style.EXTRA_STRETCH_SIZE = stretch_size or 0
@ -400,7 +397,7 @@ end
--- Lock or unlock horizontal scroll
-- @tparam Scroll self @{Scroll}
-- @tparam bool state True, if horizontal scroll is enabled
-- @tparam boolean|nil state True, if horizontal scroll is enabled
-- @treturn druid.scroll Current scroll instance
function Scroll.set_horizontal_scroll(self, state)
self._is_horizontal_scroll = state
@ -411,7 +408,7 @@ end
--- Lock or unlock vertical scroll
-- @tparam Scroll self @{Scroll}
-- @tparam bool state True, if vertical scroll is enabled
-- @tparam boolean|nil state True, if vertical scroll is enabled
-- @treturn druid.scroll Current scroll instance
function Scroll.set_vertical_scroll(self, state)
self._is_vertical_scroll = state
@ -624,8 +621,8 @@ function Scroll._check_points(self)
local temp_dist = math.huge
local temp_dist_on_inert = math.huge
local index = false
local index_on_inert = false
local index = -1
local index_on_inert = -1
local pos = self.position
for i = 1, #self.points do
@ -650,7 +647,11 @@ function Scroll._check_points(self)
end
end
self:scroll_to_index(index_on_inert or index)
if index_on_inert >= 0 then
self:scroll_to_index(index_on_inert)
else
self:scroll_to_index(index)
end
end

View File

@ -102,8 +102,8 @@ end
-- You can override this component styles params in druid styles table
-- or create your own style
-- @table style
-- @tfield[opt=false] bool IS_DYNAMIC_NODE_POSES If true, always center grid content as grid pivot sets
-- @tfield[opt=false] bool IS_ALIGN_LAST_ROW If true, always align last row of the grid as grid pivot sets
-- @tfield[opt=false] boolean IS_DYNAMIC_NODE_POSES If true, always center grid content as grid pivot sets
-- @tfield[opt=false] boolean IS_ALIGN_LAST_ROW If true, always align last row of the grid as grid pivot sets
function StaticGrid.on_style_change(self, style)
self.style = {}
self.style.IS_DYNAMIC_NODE_POSES = style.IS_DYNAMIC_NODE_POSES or false
@ -113,7 +113,7 @@ end
--- The @{StaticGrid} constructor
-- @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[opt=1] number in_row How many nodes in row can be placed
function StaticGrid.init(self, parent, element, in_row)
@ -151,7 +151,7 @@ local _temp_pos = vmath.vector3(0)
--- Return pos for grid node index
-- @tparam StaticGrid self @{StaticGrid}
-- @tparam number index The grid element index
-- @treturn vector3 Node position
-- @treturn vector3 @Node position
function StaticGrid.get_pos(self, index)
local row = math.ceil(index / self.in_row) - 1
local col = (index - row * self.in_row) - 1
@ -213,10 +213,10 @@ end
--- Add new item to the grid
-- @tparam StaticGrid self @{StaticGrid}
-- @tparam node item Gui node
-- @tparam[opt] number index The item position. By default add as last item
-- @tparam[opt=SHIFT.RIGHT] number shift_policy How shift nodes, if required. See const.SHIFT
-- @tparam[opt=false] boolean is_instant If true, update node positions instantly
-- @tparam node item GUI node
-- @tparam number|nil index The item position. By default add as last item
-- @tparam number|nil shift_policy How shift nodes, if required. Default: const.SHIFT.RIGHT
-- @tparam boolean|nil is_instant If true, update node positions instantly
function StaticGrid.add(self, item, index, shift_policy, is_instant)
index = index or ((self.last_index or 0) + 1)
@ -239,9 +239,9 @@ end
--- Remove the item from the grid. Note that gui node will be not deleted
-- @tparam StaticGrid self @{StaticGrid}
-- @tparam number index The grid node index to remove
-- @tparam[opt=SHIFT.RIGHT] number shift_policy How shift nodes, if required. See const.SHIFT
-- @tparam[opt=false] boolean is_instant If true, update node positions instantly
-- @treturn Node The deleted gui node from grid
-- @tparam number|nil shift_policy How shift nodes, if required. Default: const.SHIFT.RIGHT
-- @tparam boolean|nil is_instant If true, update node positions instantly
-- @treturn node The deleted gui node from grid
function StaticGrid.remove(self, index, shift_policy, is_instant)
assert(self.nodes[index], "No grid item at given index " .. index)
@ -379,7 +379,7 @@ end
--- Update grid inner state
-- @tparam StaticGrid self @{StaticGrid}
-- @tparam bool is_instant If true, node position update instantly, otherwise with set_position_function callback
-- @tparam boolean|nil is_instant If true, node position update instantly, otherwise with set_position_function callback
-- @local
function StaticGrid._update(self, is_instant)
self:_update_indexes()
@ -425,7 +425,7 @@ end
--- Update grid nodes position
-- @tparam StaticGrid self @{StaticGrid}
-- @tparam bool is_instant If true, node position update instantly, otherwise with set_position_function callback
-- @tparam boolean|nil is_instant If true, node position update instantly, otherwise with set_position_function callback
-- @local
function StaticGrid._update_pos(self, is_instant)
local zero_offset = self:_get_zero_offset()

View File

@ -53,6 +53,9 @@
--- Current text position
-- @tfield vector3 pos
--- The last text value
-- @tfield string last_value
--- Initial text node scale
-- @tfield vector3 start_scale
@ -222,10 +225,10 @@ function Text.on_style_change(self, style)
end
--- @{Text} constructor
--- The @{Text} constructor
-- @tparam Text self @{Text}
-- @tparam string|node node Node name or GUI Text Node itself
-- @tparam[opt] string 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
function Text.init(self, node, value, adjust_type)
self.node = self:get_node(node)
@ -273,7 +276,7 @@ end
--- Calculate text width with font with respect to trailing space
-- @tparam Text self @{Text}
-- @tparam[opt] string text
-- @tparam string|nil text
-- @treturn number Width
-- @treturn number Height
function Text.get_text_size(self, text)
@ -320,6 +323,19 @@ function Text.set_to(self, set_to)
end
--- Set text area size
-- @tparam Text self @{Text}
-- @tparam vector3 size The new text area size
-- @treturn Text Current text instance
function Text.set_size(self, size)
self.start_size = size
self.text_area = vmath.vector3(size)
self.text_area.x = self.text_area.x * self.start_scale.x
self.text_area.y = self.text_area.y * self.start_scale.y
update_adjust(self)
end
--- Set color
-- @tparam Text self @{Text}
-- @tparam vector4 color Color for node
@ -358,7 +374,7 @@ end
--- Set text pivot. Text will re-anchor inside text area
-- @tparam Text self @{Text}
-- @tparam gui.pivot pivot Gui pivot constant
-- @tparam number pivot The gui.PIVOT_* constant
-- @treturn Text Current text instance
function Text.set_pivot(self, pivot)
local prev_pivot = gui.get_pivot(self.node)
@ -384,7 +400,7 @@ end
--- Return true, if text with line break
-- @tparam Text self @{Text}
-- @treturn bool Is text node with line break
-- @treturn boolean Is text node with line break
function Text.is_multiline(self)
return gui.get_line_break(self.node)
end
@ -392,8 +408,8 @@ end
--- Set text adjust, refresh the current text visuals, if needed
-- @tparam Text self @{Text}
-- @tparam[opt] number adjust_type See const.TEXT_ADJUST. If pass nil - use current adjust type
-- @tparam[opt] number minimal_scale If pass nil - not use minimal scale
-- @tparam number|nil adjust_type See const.TEXT_ADJUST. If pass nil - use current adjust type
-- @tparam number|nil minimal_scale If pass nil - not use minimal scale
-- @treturn Text Current text instance
function Text.set_text_adjust(self, adjust_type, minimal_scale)
self.adjust_type = adjust_type

View File

@ -74,9 +74,8 @@ end
--
-- Invoke `on_style_change` on component, if exist. Component should handle
-- their style changing and store all style params
-- @function component:set_style
-- @tparam BaseComponent self @{BaseComponent}
-- @tparam table druid_style Druid style module
-- @tparam table|nil druid_style Druid style module
-- @treturn BaseComponent @{BaseComponent}
function BaseComponent.set_style(self, druid_style)
self._meta.style = druid_style or {}
@ -94,7 +93,6 @@ end
--
-- Use on all your custom components with GUI layouts used as templates.
-- It will check parent template name to build full template name in self:get_node()
-- @function component:set_template
-- @tparam BaseComponent self @{BaseComponent}
-- @tparam string template BaseComponent template name
-- @treturn BaseComponent @{BaseComponent}
@ -118,7 +116,6 @@ end
--- Get current component template name.
-- @function component:get_template
-- @tparam BaseComponent self @{BaseComponent}
-- @treturn string Component full template name
function BaseComponent.get_template(self)
@ -128,7 +125,6 @@ end
--- Set current component nodes.
-- Use if your component nodes was cloned with `gui.clone_tree` and you got the node tree.
-- @function component:set_nodes
-- @tparam BaseComponent self @{BaseComponent}
-- @tparam table nodes BaseComponent nodes table
-- @treturn BaseComponent @{BaseComponent}
@ -155,7 +151,6 @@ end
--- Context used as first arg in all Druid events
--
-- Context is usually self of gui_script.
-- @function component:get_context
-- @tparam BaseComponent self @{BaseComponent}
-- @treturn table BaseComponent context
function BaseComponent.get_context(self)
@ -164,7 +159,6 @@ end
--- Increase input priority in input stack
-- @function component:increase_input_priority
-- @tparam BaseComponent self @{BaseComponent}
-- @local
function BaseComponent.increase_input_priority(self)
@ -178,7 +172,6 @@ end
-- It autopick node by template name or from nodes by gui.clone_tree
-- if they was setup via component:set_nodes, component:set_template.
-- If node is not found, the exception will fired
-- @function component:get_node
-- @tparam BaseComponent self @{BaseComponent}
-- @tparam string|node node_or_name Node name or node itself
-- @treturn node Gui node
@ -211,9 +204,8 @@ end
--- Get Druid instance for inner component creation.
-- @function component:get_druid
-- @tparam BaseComponent self @{BaseComponent}
-- @treturn Druid Druid instance with component context
-- @treturn DruidInstance Druid instance with component context
function BaseComponent.get_druid(self)
local context = { _context = self }
return setmetatable(context, { __index = self._meta.druid })
@ -221,7 +213,6 @@ end
--- Return component name
-- @function component:get_name
-- @tparam BaseComponent self @{BaseComponent}
-- @treturn string The component name
function BaseComponent.get_name(self)
@ -230,7 +221,6 @@ end
--- Return parent component name
-- @function component:get_parent_name
-- @tparam BaseComponent self @{BaseComponent}
-- @treturn string|nil The parent component name if exist or bil
function BaseComponent.get_parent_name(self)
@ -240,7 +230,6 @@ end
--- Return component input priority
-- @function component:get_input_priority
-- @tparam BaseComponent self @{BaseComponent}
-- @treturn number The component input priority
function BaseComponent.get_input_priority(self)
@ -251,10 +240,9 @@ end
--- Set component input priority
--
-- Default value: 10
-- @function component:set_input_priority
-- @tparam BaseComponent self @{BaseComponent}
-- @tparam number value The new input priority value
-- @tparam boolean is_temporary If true, the reset input priority will return to previous value
-- @tparam boolean|nil is_temporary If true, the reset input priority will return to previous value
-- @treturn number The component input priority
function BaseComponent.set_input_priority(self, value, is_temporary)
assert(value)
@ -280,7 +268,6 @@ end
--- Reset component input priority to default value
-- @function component:reset_input_priority
-- @tparam BaseComponent self @{BaseComponent}
-- @treturn number The component input priority
function BaseComponent.reset_input_priority(self)
@ -292,7 +279,6 @@ end
--- Return component UID.
--
-- UID generated in component creation order.
-- @function component:get_uid
-- @tparam BaseComponent self @{BaseComponent}
-- @treturn number The component uid
function BaseComponent.get_uid(self)
@ -303,9 +289,8 @@ end
--- Set component input state. By default it enabled
--
-- If input is disabled, the component will not receive input events
-- @function component:set_input_enabled
-- @tparam BaseComponent self @{BaseComponent}
-- @tparam bool state The component input state
-- @tparam boolean|nil state The component input state
-- @treturn BaseComponent BaseComponent itself
function BaseComponent.set_input_enabled(self, state)
self._meta.input_enabled = state
@ -319,7 +304,6 @@ end
--- Return the parent component if exist
-- @function component:get_parent_component
-- @tparam BaseComponent self @{BaseComponent}
-- @treturn BaseComponent|nil The druid component instance or nil
function BaseComponent.get_parent_component(self)
@ -328,7 +312,6 @@ end
--- Setup component context and his style table
-- @function component:setup_component
-- @tparam BaseComponent self @{BaseComponent}
-- @tparam table druid_instance The parent druid instance
-- @tparam table context Druid context. Usually it is self of script
@ -362,10 +345,9 @@ end
--- Basic constructor of component. It will call automaticaly
-- by `BaseComponent.create`
-- @function component:initialize
-- @tparam BaseComponent self @{BaseComponent}
-- @tparam string name BaseComponent name
-- @tparam[opt=DEFAULT] number input_priority The input priority. The bigger number processed first
-- @tparam number|nil input_priority The input priority. The bigger number processed first
-- @local
function BaseComponent.initialize(self, name, input_priority)
self._component = {
@ -380,7 +362,6 @@ end
--- Print log information if debug mode is enabled
-- @function component:log_message
-- @tparam BaseComponent self @{BaseComponent}
-- @tparam string message
-- @tparam table context
@ -394,9 +375,8 @@ end
--- Set debug logs for component enabled or disabled
-- @function component:set_debug
-- @tparam BaseComponent self @{BaseComponent}
-- @tparam bool is_debug
-- @tparam boolean|nil is_debug
-- @local
function BaseComponent.set_debug(self, is_debug)
self._component.is_debug = is_debug
@ -404,7 +384,6 @@ end
--- Return true, if input priority was changed
-- @function component:_is_input_priority_changed
-- @tparam BaseComponent self @{BaseComponent}
-- @local
function BaseComponent._is_input_priority_changed(self)
@ -413,7 +392,6 @@ end
--- Reset is_input_priority_changed field
-- @function component:_reset_input_priority_changed
-- @tparam BaseComponent self @{BaseComponent}
-- @local
function BaseComponent._reset_input_priority_changed(self)
@ -427,7 +405,6 @@ end
--- Get current component interests
-- @function component:__get_interests
-- @tparam BaseComponent self @{BaseComponent}
-- @treturn table List of component interests
-- @local
@ -451,7 +428,6 @@ end
--- Get current component nodes
-- @function component:__get_nodes
-- @tparam BaseComponent self @{BaseComponent}
-- @treturn table BaseComponent nodes table
-- @local
@ -466,7 +442,6 @@ end
--- Add child to component children list
-- @function component:__add_children
-- @tparam BaseComponent self @{BaseComponent}
-- @tparam component children The druid component instance
-- @local
@ -476,7 +451,6 @@ end
--- Remove child from component children list
-- @function component:__remove_children
-- @tparam BaseComponent self @{BaseComponent}
-- @tparam component children The druid component instance
-- @local
@ -490,7 +464,6 @@ end
--- Return all children components, recursive
-- @function component:get_childrens
-- @tparam BaseComponent self @{BaseComponent}
-- @treturn table Array of childrens if the Druid component instance
function BaseComponent.get_childrens(self)
@ -510,7 +483,7 @@ end
--- Create new component. It will inheritance from basic Druid component.
-- @function BaseComponent.create
-- @tparam string name BaseComponent name
-- @tparam[opt=DEFAULT] number input_priority The input priority. The bigger number processed first
-- @tparam number|nil input_priority The input priority. The bigger number processed first
-- @local
function BaseComponent.create(name, input_priority)
-- Yea, inheritance here

View File

@ -7,20 +7,20 @@
local M = {}
M.ACTION_TEXT = hash(sys.get_config("druid.input_text", "text"))
M.ACTION_TOUCH = hash(sys.get_config("druid.input_touch", "touch"))
M.ACTION_MARKED_TEXT = hash(sys.get_config("druid.input_marked_text", "marked_text"))
M.ACTION_ESC = hash(sys.get_config("druid.input_key_esc", "key_esc"))
M.ACTION_BACK = hash(sys.get_config("druid.input_key_back", "key_back"))
M.ACTION_ENTER = hash(sys.get_config("druid.input_key_enter", "key_enter"))
M.ACTION_MULTITOUCH = hash(sys.get_config("druid.input_multitouch", "touch_multi"))
M.ACTION_BACKSPACE = hash(sys.get_config("druid.input_key_backspace", "key_backspace"))
M.ACTION_SCROLL_UP = hash(sys.get_config("druid.input_scroll_up", "mouse_wheel_up"))
M.ACTION_SCROLL_DOWN = hash(sys.get_config("druid.input_scroll_down", "mouse_wheel_down"))
M.ACTION_TEXT = hash(sys.get_config_string("druid.input_text", "text"))
M.ACTION_TOUCH = hash(sys.get_config_string("druid.input_touch", "touch"))
M.ACTION_MARKED_TEXT = hash(sys.get_config_string("druid.input_marked_text", "marked_text"))
M.ACTION_ESC = hash(sys.get_config_string("druid.input_key_esc", "key_esc"))
M.ACTION_BACK = hash(sys.get_config_string("druid.input_key_back", "key_back"))
M.ACTION_ENTER = hash(sys.get_config_string("druid.input_key_enter", "key_enter"))
M.ACTION_MULTITOUCH = hash(sys.get_config_string("druid.input_multitouch", "touch_multi"))
M.ACTION_BACKSPACE = hash(sys.get_config_string("druid.input_key_backspace", "key_backspace"))
M.ACTION_SCROLL_UP = hash(sys.get_config_string("druid.input_scroll_up", "mouse_wheel_up"))
M.ACTION_SCROLL_DOWN = hash(sys.get_config_string("druid.input_scroll_down", "mouse_wheel_down"))
M.IS_STENCIL_CHECK = not (sys.get_config_string("druid.no_stencil_check") == "1")
M.IS_STENCIL_CHECK = not (sys.get_config("druid.no_stencil_check") == "1")
--- Component Interests
M.ON_INPUT = "on_input"
M.ON_UPDATE = "update"
M.ON_MESSAGE = "on_message"

View File

@ -10,7 +10,7 @@
-- @tfield DruidInstance druid @{DruidInstance}
--- Is currently under user control
-- @tfield bool is_drag
-- @tfield boolean is_drag
--- The pin node
-- @tfield node node
@ -52,7 +52,7 @@ local function set_angle(self, value)
end
--- Component init function
--- The @{PinKnob} constructor
-- @tparam PinKnob self @{PinKnob}
-- @tparam function callback Callback(self, value) on value changed
-- @tparam string template The template string name

View File

@ -9,6 +9,9 @@
--- The component druid instance
-- @tfield DruidInstance druid @{DruidInstance}
--- Root node
-- @tfield node root
--- On input field text change callback(self, input_text)
-- @tfield Input input @{Input}
@ -61,7 +64,7 @@ local function on_unselect(self)
end
--- Component init function
--- The @{RichInput} constructor
-- @tparam RichInput self @{RichInput}
-- @tparam string template The template string name
-- @tparam table nodes Nodes table from gui.clone_tree
@ -69,6 +72,8 @@ function RichInput.init(self, template, nodes)
self:set_template(template)
self:set_nodes(nodes)
self.druid = self:get_druid()
self.root = self:get_node(SCHEME.ROOT)
self.input = self.druid:new_input(self:get_node(SCHEME.BUTTON), self:get_node(SCHEME.INPUT))
self.cursor = self:get_node(SCHEME.CURSOR)
@ -85,11 +90,33 @@ end
--- Set placeholder text
-- @tparam RichInput self @{RichInput}
-- @tparam string placeholder_text The placeholder text
-- @tparam string|nil placeholder_text The placeholder text
-- @treturn RichInput Current instance
function RichInput.set_placeholder(self, placeholder_text)
self.placeholder:set_to(placeholder_text)
return self
end
---GSet input field text
-- @tparam RichInput self @{RichInput}
-- @treturn string Current input text
function RichInput.get_text(self)
return self.input:get_text()
end
--- Set allowed charaters for input field.
-- See: https://defold.com/ref/stable/string/
-- ex: [%a%d] for alpha and numeric
-- @tparam RichInput self @{RichInput}
-- @tparam string characters Regulax exp. for validate user input
-- @treturn RichInput Current instance
function RichInput.set_allowed_characters(self, characters)
self.input:set_allowed_characters(characters)
return self
end
return RichInput

View File

@ -90,6 +90,7 @@
--- The component druid instance
-- @tfield DruidInstance druid @{DruidInstance}
--
local component = require("druid.component")
local rich_text = require("druid.custom.rich_text.module.rt")
@ -103,7 +104,7 @@ local SCHEME = {
}
--- Rich Text component constructor
--- The @{RichText} constructor
-- @tparam RichText self @{RichText}
-- @tparam string template The Rich Text template name
-- @tparam table nodes The node table, if prefab was copied by gui.clone_tree()

View File

@ -92,7 +92,7 @@ end
--
-- @function druid.new
-- @tparam table context The Druid context. Usually, this is the self of the gui_script. It is passed into all Druid callbacks.
-- @tparam[opt] table style The Druid style table to override style parameters for this Druid instance.
-- @tparam table|nil style The Druid style table to override style parameters for this Druid instance.
-- @treturn druid_instance The Druid instance @{DruidInstance}.
-- @usage
-- local druid = require("druid.druid")

View File

@ -15,7 +15,7 @@ local DruidEvent = class("druid.event")
--- DruidEvent constructor
-- @tparam DruidEvent self @{DruidEvent}
-- @tparam[opt] function initial_callback Subscribe the callback on new event, if callback exist
-- @tparam function|nil initial_callback Subscribe the callback on new event, if callback exist
-- @usage
-- local Event = require("druid.event")
-- ...
@ -32,7 +32,7 @@ end
--- Subscribe callback on event
-- @tparam DruidEvent self @{DruidEvent}
-- @tparam function callback Callback itself
-- @tparam[opt] Any context Additional context as first param to callback call, usually it's self
-- @tparam any|nil context Additional context as first param to callback call, usually it's self
-- @usage
-- local function on_long_callback(self)
-- print("Long click!")
@ -57,7 +57,7 @@ end
--- Unsubscribe callback on event
-- @tparam DruidEvent self @{DruidEvent}
-- @tparam function callback Callback itself
-- @tparam[opt] Any context Additional context as first param to callback call
-- @tparam any|nil context Additional context as first param to callback call
-- @usage
-- local function on_long_callback(self)
-- print("Long click!")
@ -80,7 +80,7 @@ end
--- Return true, if event have at lease one handler
-- @tparam DruidEvent self @{DruidEvent}
-- @treturn bool True if event have handlers
-- @treturn boolean True if event have handlers
-- @usage
-- local is_long_click_handler_exists = button.on_long_click:is_exist()
function DruidEvent.is_exist(self)
@ -102,7 +102,7 @@ end
--- Trigger the event and call all subscribed callbacks
-- @tparam DruidEvent self @{DruidEvent}
-- @tparam Any ... All event params
-- @tparam any ... All event params
-- @usage
-- local Event = require("druid.event")
-- ...

View File

@ -46,7 +46,7 @@ function Checkbox.on_style_change(self, style)
end
--- Component init function
--- The @{Checkbox} constructor
-- @tparam Checkbox self @{Checkbox}
-- @tparam node node Gui node
-- @tparam function callback Checkbox callback
@ -71,9 +71,9 @@ end
--- Set checkbox state
-- @tparam Checkbox self @{Checkbox}
-- @tparam bool state Checkbox state
-- @tparam bool is_silent Don't trigger on_change_state if true
-- @tparam bool is_instant If instant checkbox change
-- @tparam boolean|nil state Checkbox state
-- @tparam boolean|nil is_silent Don't trigger on_change_state if true
-- @tparam boolean|nil is_instant If instant checkbox change
function Checkbox.set_state(self, state, is_silent, is_instant)
self.state = state
self.style.on_change_state(self, self.node, state, is_instant)
@ -88,7 +88,7 @@ end
--- Return checkbox state
-- @tparam Checkbox self @{Checkbox}
-- @treturn bool Checkbox state
-- @treturn boolean Checkbox state
function Checkbox.get_state(self)
return self.state
end

View File

@ -21,7 +21,7 @@ local component = require("druid.component")
local CheckboxGroup = component.create("checkbox_group")
--- Component init function
--- The @{CheckboxGroup} constructor
-- @tparam CheckboxGroup self @{CheckboxGroup}
-- @tparam node[] nodes Array of gui node
-- @tparam function callback Checkbox callback
@ -45,8 +45,8 @@ end
--- Set checkbox group state
-- @tparam CheckboxGroup self @{CheckboxGroup}
-- @tparam bool[] indexes Array of checkbox state
-- @tparam boolean is_instant If instant state change
-- @tparam boolean[] indexes Array of checkbox state
-- @tparam boolean|nil is_instant If instant state change
function CheckboxGroup.set_state(self, indexes, is_instant)
for i = 1, #indexes do
if self.checkboxes[i] then
@ -58,7 +58,7 @@ end
--- Return checkbox group state
-- @tparam CheckboxGroup self @{CheckboxGroup}
-- @treturn bool[] Array if checkboxes state
-- @treturn boolean[] Array if checkboxes state
function CheckboxGroup.get_state(self)
local result = {}

View File

@ -43,7 +43,7 @@ local Event = require("druid.event")
local DataList = component.create("data_list")
--- Data list constructor
--- The @{DataList} constructor
-- @tparam DataList self @{DataList}
-- @tparam Scroll scroll The @{Scroll} instance for Data List component
-- @tparam StaticGrid|DynamicGrid grid The @{StaticGrid} or @{DynamicGrid} instance for Data List component
@ -197,7 +197,7 @@ end
--- Return all currenly created nodes in DataList
-- @tparam DataList self @{DataList}
-- @treturn Node[] List of created nodes
-- @treturn node[] List of created nodes
function DataList.get_created_nodes(self)
local nodes = {}

View File

@ -65,7 +65,7 @@ local AVAILABLE_PIVOTS = {
}
--- Component init function
--- The @{DynamicGrid} constructor
-- @tparam DynamicGrid self @{DynamicGrid}
-- @tparam node parent The gui node parent, where items will be placed
function DynamicGrid.init(self, parent)
@ -100,7 +100,7 @@ end
-- @tparam DynamicGrid self @{DynamicGrid}
-- @tparam number index The grid element index
-- @tparam node node The node to be placed
-- @tparam[opt] number origin_index Index of nearby node
-- @tparam number|nil origin_index Index of nearby node
-- @treturn vector3 Node position
function DynamicGrid.get_pos(self, index, node, origin_index)
local origin_node = self.nodes[origin_index]
@ -140,9 +140,9 @@ end
--- Add new node to the grid
-- @tparam DynamicGrid self @{DynamicGrid}
-- @tparam node node Gui node
-- @tparam[opt] number index The node position. By default add as last node
-- @tparam[opt=SHIFT.RIGHT] number shift_policy How shift nodes, if required. See const.SHIFT
-- @tparam[opt=false] boolean is_instant If true, update node positions instantly
-- @tparam number|nil index The node position. By default add as last node
-- @tparam number|nil shift_policy How shift nodes, if required. Default: const.SHIFT.RIGHT
-- @tparam boolean|nil is_instant If true, update node positions instantly
function DynamicGrid.add(self, node, index, shift_policy, is_instant)
shift_policy = shift_policy or const.SHIFT.RIGHT
local delta = shift_policy -- -1 or 1 or 0
@ -183,8 +183,8 @@ end
--- Remove the item from the grid. Note that gui node will be not deleted
-- @tparam DynamicGrid self @{DynamicGrid}
-- @tparam number index The grid node index to remove
-- @tparam[opt=SHIFT.RIGHT] number shift_policy How shift nodes, if required. See const.SHIFT
-- @tparam[opt=false] boolean is_instant If true, update node positions instantly
-- @tparam number|nil shift_policy How shift nodes, if required. Default: const.SHIFT.RIGHT
-- @tparam boolean|nil is_instant If true, update node positions instantly
-- @treturn node The deleted gui node from grid
function DynamicGrid.remove(self, index, shift_policy, is_instant)
shift_policy = shift_policy or const.SHIFT.RIGHT
@ -322,7 +322,7 @@ end
--- Update grid inner state
-- @tparam DynamicGrid self @{DynamicGrid}
-- @tparam bool is_instant If true, node position update instantly, otherwise with set_position_function callback
-- @tparam boolean|nil is_instant If true, node position update instantly, otherwise with set_position_function callback
-- @local
function DynamicGrid._update(self, is_instant)
self:_update_indexes()
@ -378,7 +378,7 @@ end
--- Update grid nodes position
-- @tparam DynamicGrid self @{DynamicGrid}
-- @tparam bool is_instant If true, node position update instantly, otherwise with set_position_function callback
-- @tparam boolean|nil is_instant If true, node position update instantly, otherwise with set_position_function callback
-- @local
function DynamicGrid._update_pos(self, is_instant)
for index, node in pairs(self.nodes) do

View File

@ -27,11 +27,11 @@ local component = require("druid.component")
local Hotkey = component.create("hotkey")
--- Component init function
--- The @{Hotkey} constructor
-- @tparam Hotkey self @{Hotkey}
-- @tparam string[]|string keys The keys to be pressed for trigger callback. Should contains one key and any modificator keys
-- @tparam function callback The callback function
-- @tparam[opt] value callback_argument The argument to pass into the callback function
-- @tparam any|nil callback_argument The argument to pass into the callback function
function Hotkey.init(self, keys, callback, callback_argument)
self.druid = self:get_druid()
@ -63,7 +63,8 @@ end
--- Add hotkey for component callback
-- @tparam Hotkey self @{Hotkey}
-- @tparam string[]|hash[]|string|hash keys that have to be pressed before key pressed to activate
-- @tparam[opt] value callback_argument The argument to pass into the callback function
-- @tparam any|nil callback_argument The argument to pass into the callback function
-- @treturn Hotkey Current instance
function Hotkey.add_hotkey(self, keys, callback_argument)
keys = keys or {}
if type(keys) == "string" then

View File

@ -34,10 +34,10 @@
-- @tfield Button button @{Button}
--- Is current input selected now
-- @tfield bool is_selected
-- @tfield boolean is_selected
--- Is current input is empty now
-- @tfield bool is_empty
-- @tfield boolean is_empty
--- Max length for input text
-- @tfield[opt] number max_length
@ -87,10 +87,10 @@ end
-- You can override this component styles params in druid styles table
-- or create your own style
-- @table style
-- @tfield[opt=false] bool IS_LONGTAP_ERASE Is long tap will erase current input data
-- @tfield[opt=false] boolean IS_LONGTAP_ERASE Is long tap will erase current input data
-- @tfield[opt=*] string MASK_DEFAULT_CHAR Default character mask for password input
-- @tfield[opt=false] bool IS_UNSELECT_ON_RESELECT If true, call unselect on select selected input
-- @tfield[opt=false] bool 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[opt=false] boolean IS_UNSELECT_ON_RESELECT If true, call unselect on select selected input
-- @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 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_input_wrong (self, button_node) Callback on wrong user input
@ -115,11 +115,11 @@ function Input.on_style_change(self, style)
end
--- Component init function
--- The @{Input} constructor
-- @tparam Input self @{Input}
-- @tparam node click_node Node to enabled input component
-- @tparam node|Text text_node Text node what will be changed on user input. You can pass text component instead of text node name @{Text}
-- @tparam[opt] number keyboard_type Gui keyboard type for input field
-- @tparam number|nil keyboard_type Gui keyboard type for input field
function Input.init(self, click_node, text_node, keyboard_type)
self.druid = self:get_druid(self)
@ -302,7 +302,7 @@ function Input.select(self)
self.style.on_select(self, self.button.node)
else
if self.style.IS_UNSELECT_ON_RESELECT then
self:unselect(self)
self:unselect()
end
end
end

View File

@ -23,6 +23,9 @@
--- The text component
-- @tfield Text text @{Text}
--- Text node
-- @tfield node node
---
local Event = require("druid.event")
@ -34,8 +37,8 @@ local LangText = component.create("lang_text")
--- The @{LangText} constructor
-- @tparam LangText self @{LangText}
-- @tparam string|node node Node name or GUI Text Node itself
-- @tparam string locale_id Default locale id or text from node as default
-- @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[opt=downscale] string 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)
self.druid = self:get_druid()
@ -75,13 +78,13 @@ end
--- Translate the text by locale_id
-- @tparam LangText self @{LangText}
-- @tparam string locale_id Locale id
-- @tparam[opt] string a Optional param to string.format
-- @tparam[opt] string b Optional param to string.format
-- @tparam[opt] string c Optional param to string.format
-- @tparam[opt] string d Optional param to string.format
-- @tparam[opt] string e Optional param to string.format
-- @tparam[opt] string f Optional param to string.format
-- @tparam[opt] string g Optional param to string.format
-- @tparam string|nil a Optional param to string.format
-- @tparam string|nil b Optional param to string.format
-- @tparam string|nil c Optional param to string.format
-- @tparam string|nil d Optional param to string.format
-- @tparam string|nil e Optional param to string.format
-- @tparam string|nil f Optional param to string.format
-- @tparam string|nil g Optional param to string.format
-- @treturn LangText Current instance
function LangText.translate(self, locale_id, a, b, c, d, e, f, g)
self.last_locale_args = { a, b, c, d, e, f, g }
@ -94,13 +97,13 @@ end
--- Format string with new text params on localized text
-- @tparam LangText self @{LangText}
-- @tparam[opt] string a Optional param to string.format
-- @tparam[opt] string b Optional param to string.format
-- @tparam[opt] string c Optional param to string.format
-- @tparam[opt] string d Optional param to string.format
-- @tparam[opt] string e Optional param to string.format
-- @tparam[opt] string f Optional param to string.format
-- @tparam[opt] string g Optional param to string.format
-- @tparam string|nil a Optional param to string.format
-- @tparam string|nil b Optional param to string.format
-- @tparam string|nil c Optional param to string.format
-- @tparam string|nil d Optional param to string.format
-- @tparam string|nil e Optional param to string.format
-- @tparam string|nil f Optional param to string.format
-- @tparam string|nil g Optional param to string.format
-- @treturn LangText Current instance
function LangText.format(self, a, b, c, d, e, f, g)
self.last_locale_args = { a, b, c, d, e, f, g }

View File

@ -28,11 +28,11 @@ local Event = require("druid.event")
local Layout = component.create("layout")
--- Component init function
--- The @{Layout} constructor
-- @tparam Layout self @{Layout}
-- @tparam node node Gui node
-- @tparam string mode The layout mode (from const.LAYOUT_MODE)
-- @tparam[opt] function on_size_changed_callback The callback on window resize
-- @tparam function|nil on_size_changed_callback The callback on window resize
function Layout.init(self, node, mode, on_size_changed_callback)
self.node = self:get_node(node)
@ -194,7 +194,7 @@ end
--- Set node for layout node to fit inside it. Pass nil to reset
-- @tparam Layout self @{Layout}
-- @tparam[opt] Node node
-- @tparam node|nil node
-- @treturn Layout @{Layout}
function Layout.fit_into_node(self, node)
self._fit_node = node

View File

@ -110,7 +110,7 @@ function Progress.on_style_change(self, style)
end
--- @{Progress} constructor
--- The @{Progress} constructor
-- @tparam Progress self @{Progress}
-- @tparam string|node node Node name or GUI Node itself.
-- @tparam string key Progress bar direction: const.SIDE.X or const.SIDE.Y
@ -210,7 +210,7 @@ end
--- Start animation of a progress bar
-- @tparam Progress self @{Progress}
-- @tparam number to value between 0..1
-- @tparam[opt] function callback Callback on animation ends
-- @tparam function|nil callback Callback on animation ends
function Progress.to(self, to, callback)
to = helper.clamp(to, 0, 1)
-- cause of float error

View File

@ -30,7 +30,7 @@ local function on_checkbox_click(self, index, is_instant)
end
--- Component init function
--- The @{RadioGroup} constructor
-- @tparam RadioGroup self @{RadioGroup}
-- @tparam node[] nodes Array of gui node
-- @tparam function callback Radio callback
@ -55,7 +55,7 @@ end
--- Set radio group state
-- @tparam RadioGroup self @{RadioGroup}
-- @tparam number index Index in radio group
-- @tparam boolean is_instant If is instant state change
-- @tparam boolean|nil is_instant If is instant state change
function RadioGroup.set_state(self, index, is_instant)
on_checkbox_click(self, index, is_instant)
end

View File

@ -29,7 +29,7 @@
-- @tfield number dist
--- Current drag state
-- @tfield bool is_drag
-- @tfield boolean is_drag
--- Current slider value
-- @tfield number value
@ -56,11 +56,11 @@ local function set_position(self, value)
end
--- Component init function
--- The @{Slider} constructor
-- @tparam Slider self @{Slider}
-- @tparam node node Gui pin node
-- @tparam vector3 end_pos The end position of slider
-- @tparam[opt] function callback On slider change callback
-- @tparam function|nil callback On slider change callback
function Slider.init(self, node, end_pos, callback)
self.node = self:get_node(node)
@ -174,7 +174,7 @@ end
--- Set value for slider
-- @tparam Slider self @{Slider}
-- @tparam number value Value from 0 to 1
-- @tparam[opt] bool is_silent Don't trigger event if true
-- @tparam boolean|nil is_silent Don't trigger event if true
function Slider.set(self, value, is_silent)
value = helper.clamp(value, 0, 1)
set_position(self, value)
@ -202,7 +202,7 @@ end
-- move at this position and node drag will start.
-- This function require the Defold version 1.3.0+
-- @tparam Slider self @{Slider}
-- @tparam Node input_node
-- @tparam node input_node
-- @treturn Slider @{Slider}
function Slider.set_input_node(self, input_node)
self._input_node = self:get_node(input_node)

View File

@ -13,7 +13,7 @@
-- @tparam node node
--- Restriction zone
-- @tparam[opt] node click_zone
-- @tparam node|nil click_zone
--- Trigger on swipe event(self, swipe_side, dist, delta_time)
-- @tfield DruidEvent on_swipe) @{DruidEvent}
@ -76,7 +76,7 @@ end
-- @table style
-- @tfield[opt=0.4] number SWIPE_TIME Maximum time for swipe trigger
-- @tfield[opt=50] number SWIPE_THRESHOLD Minimum distance for swipe trigger
-- @tfield[opt=false] bool SWIPE_TRIGGER_ON_MOVE If true, trigger on swipe moving, not only release action
-- @tfield[opt=false] boolean SWIPE_TRIGGER_ON_MOVE If true, trigger on swipe moving, not only release action
function Swipe.on_style_change(self, style)
self.style = {}
self.style.SWIPE_TIME = style.SWIPE_TIME or 0.4
@ -85,7 +85,7 @@ function Swipe.on_style_change(self, style)
end
--- Component init function
--- The @{Swipe} constructor
-- @tparam Swipe self @{Swipe}
-- @tparam node node Gui node
-- @tparam function on_swipe_callback Swipe callback for on_swipe_end event

View File

@ -44,12 +44,12 @@ local function second_string_min(sec)
end
--- Component init function
--- The @{Timer} constructor
-- @tparam Timer self @{Timer}
-- @tparam node node Gui text node
-- @tparam number seconds_from Start timer value in seconds
-- @tparam[opt=0] number seconds_to End timer value in seconds
-- @tparam[opt] function callback Function on timer end
-- @tparam number|nil seconds_to End timer value in seconds
-- @tparam function|nil callback Function on timer end
function Timer.init(self, node, seconds_from, seconds_to, callback)
self.node = self:get_node(node)
seconds_from = math.max(seconds_from, 0)
@ -110,7 +110,7 @@ end
--- Called when update
-- @tparam Timer self @{Timer}
-- @tparam bool is_on Timer enable state
-- @tparam boolean|nil is_on Timer enable state
function Timer.set_state(self, is_on)
self.is_on = is_on

View File

@ -48,8 +48,8 @@ end
-- Nodes will be center around 0 x position
-- text_node will be first (at left side)
-- @function helper.centrate_text_with_icon
-- @tparam[opt] text text_node Gui text node
-- @tparam[opt] box icon_node Gui box node
-- @tparam text|nil text_node Gui text node
-- @tparam box|nil icon_node Gui box node
-- @tparam number margin Offset between nodes
-- @local
function M.centrate_text_with_icon(text_node, icon_node, margin)
@ -61,9 +61,9 @@ end
-- Nodes will be center around 0 x position
-- icon_node will be first (at left side)
-- @function helper.centrate_icon_with_text
-- @tparam[opt] box icon_node Gui box node
-- @tparam[opt] text text_node Gui text node
-- @tparam[opt=0] number margin Offset between nodes
-- @tparam box|nil icon_node Gui box node
-- @tparam text|nil text_node Gui text node
-- @tparam number|nil margin Offset between nodes
-- @local
function M.centrate_icon_with_text(icon_node, text_node, margin)
return M.centrate_nodes(margin, icon_node, text_node)
@ -75,7 +75,7 @@ end
-- This functions calculate total width of nodes and set position for each node.
-- The centrate will be around 0 x position.
-- @function helper.centrate_nodes
-- @tparam[opt=0] number margin Offset between nodes
-- @tparam number|nil margin Offset between nodes
-- @param ... Gui nodes
function M.centrate_nodes(margin, ...)
margin = margin or 0
@ -200,7 +200,7 @@ end
--- Round number to specified decimal places
-- @function helper.round
-- @tparam number num Number
-- @tparam[opt=0] number num_decimal_places Decimal places
-- @tparam number|nil num_decimal_places Decimal places
-- @treturn number Rounded number
function M.round(num, num_decimal_places)
local mult = 10^(num_decimal_places or 0)
@ -255,9 +255,9 @@ end
--- Add all elements from source array to the target array
-- @function helper.add_array
-- @tparam table target Array to put elements from source
-- @tparam[opt] table source The source array to get elements from
-- @treturn array The target array
-- @tparam any[] target Array to put elements from source
-- @tparam any[]|nil source The source array to get elements from
-- @treturn any[] The target array
function M.add_array(target, source)
assert(target)
@ -275,10 +275,10 @@ end
--- Make a check with gui.pick_node, but with additional node_click_area check.
-- @function helper.pick_node
-- @tparam Node node
-- @tparam node node
-- @tparam number x
-- @tparam number y
-- @tparam[opt] Node node_click_area
-- @tparam node|nil node_click_area
-- @local
function M.pick_node(node, x, y, node_click_area)
local is_pick = gui.pick_node(node, x, y)
@ -302,7 +302,7 @@ end
--- Get cumulative parent's node scale
-- @function helper.get_scene_scale
-- @tparam node node Gui node
-- @tparam bool include_passed_node_scale True if add current node scale to result
-- @tparam boolean|nil include_passed_node_scale True if add current node scale to result
-- @treturn vector3 The scene node scale
function M.get_scene_scale(node, include_passed_node_scale)
local scale = include_passed_node_scale and gui.get_scale(node) or vmath.vector3(1)
@ -345,7 +345,7 @@ end
--
-- Offset shown in [-0.5 .. 0.5] range, where -0.5 is left or bottom, 0.5 is right or top.
-- @function helper.get_pivot_offset
-- @tparam gui.pivot pivot The node pivot
-- @tparam number pivot The gui.PIVOT_* constant
-- @treturn vector3 Vector offset with [-0.5..0.5] values
function M.get_pivot_offset(pivot)
return const.PIVOTS[pivot]
@ -354,7 +354,7 @@ end
--- Check if device is native mobile (Android or iOS)
-- @function helper.is_mobile
-- @treturn bool Is mobile
-- @treturn boolean Is mobile
function M.is_mobile()
return const.CURRENT_SYSTEM_NAME == const.OS.IOS or
const.CURRENT_SYSTEM_NAME == const.OS.ANDROID
@ -363,7 +363,7 @@ end
--- Check if device is HTML5
-- @function helper.is_web
-- @treturn bool Is web
-- @treturn boolean Is web
function M.is_web()
return const.CURRENT_SYSTEM_NAME == const.OS.BROWSER
end
@ -394,7 +394,7 @@ end
--- Distance from node position to his borders
-- @function helper.get_border
-- @tparam node node GUI node
-- @tparam[opt] vector3 offset Offset from node position. Pass current node position to get non relative border values
-- @tparam vector3|nil offset Offset from node position. Pass current node position to get non relative border values
-- @treturn vector4 Vector4 with border values (left, top, right, down)
function M.get_border(node, offset)
local pivot = gui.get_pivot(node)
@ -420,7 +420,7 @@ end
--- Get text metric from GUI node.
-- @function helper.get_text_metrics_from_node
-- @tparam Node text_node
-- @tparam node text_node
-- @treturn GUITextMetrics
-- @usage
-- type GUITextMetrics = {
@ -451,10 +451,10 @@ end
-- Shift policy can be: left, right, no_shift
-- @function helper.insert_with_shift
-- @tparam table array Array
-- @param item Item to insert
-- @tparam[opt] number index Index to insert. If nil, item will be inserted at the end of array
-- @tparam[opt] const.SHIFT shift_policy Shift policy
-- @treturn item Inserted item
-- @param any Item to insert
-- @tparam number|nil index Index to insert. If nil, item will be inserted at the end of array
-- @tparam number|nil shift_policy The druid_const.SHIFT.* constant
-- @treturn any Inserted item
function M.insert_with_shift(array, item, index, shift_policy)
shift_policy = shift_policy or const.SHIFT.RIGHT
@ -483,9 +483,9 @@ end
-- Shift policy can be: left, right, no_shift
-- @function helper.remove_with_shift
-- @tparam table array Array
-- @tparam[opt] number index Index to remove. If nil, item will be removed from the end of array
-- @tparam[opt] const.SHIFT shift_policy Shift policy
-- @treturn item Removed item
-- @tparam number|nil index Index to remove. If nil, item will be removed from the end of array
-- @tparam number|nil shift_policy The druid_const.SHIFT.* constant
-- @treturn any Removed item
function M.remove_with_shift(array, index, shift_policy)
shift_policy = shift_policy or const.SHIFT.RIGHT

View File

@ -259,8 +259,9 @@ end
--- Create new component.
-- @tparam DruidInstance self
-- @tparam Component component Component module
-- @tparam args ... Other component params to pass it to component:init function
-- @tparam BaseComponent component Component module
-- @tparam any ... Other component params to pass it to component:init function
-- @treturn BaseComponent Component instance
function DruidInstance.new(self, component, ...)
local instance = create(self, component)
@ -296,7 +297,7 @@ end
--
-- Component `on_remove` function will be invoked, if exist.
-- @tparam DruidInstance self
-- @tparam Component component Component instance
-- @tparam BaseComponent component Component instance
function DruidInstance.remove(self, component)
if self._is_late_remove_enabled then
table.insert(self._late_remove, component)
@ -380,7 +381,7 @@ end
-- @tparam DruidInstance self
-- @tparam hash action_id Action_id from on_input
-- @tparam table action Action from on_input
-- @treturn bool The boolean value is input was consumed
-- @treturn boolean The boolean value is input was consumed
function DruidInstance.on_input(self, action_id, action)
self._is_late_remove_enabled = true
@ -477,7 +478,7 @@ end
-- If whitelist is not empty and component not contains in this list,
-- component will be not processed on input step
-- @tparam DruidInstance self
-- @tparam[opt=nil] table|Component whitelist_components The array of component to whitelist
-- @tparam[opt=nil] table|BaseComponent whitelist_components The array of component to whitelist
-- @treturn self @{DruidInstance}
function DruidInstance.set_whitelist(self, whitelist_components)
if whitelist_components and whitelist_components.isInstanceOf then
@ -499,7 +500,7 @@ end
-- If blacklist is not empty and component contains in this list,
-- component will be not processed on input step
-- @tparam DruidInstance self @{DruidInstance}
-- @tparam[opt=nil] table|Component blacklist_components The array of component to blacklist
-- @tparam[opt=nil] table|BaseComponent blacklist_components The array of component to blacklist
-- @treturn self @{DruidInstance}
function DruidInstance.set_blacklist(self, blacklist_components)
if blacklist_components and blacklist_components.isInstanceOf then
@ -518,7 +519,7 @@ end
--- Set debug mode for current Druid instance. It's enable debug log messages
-- @tparam DruidInstance self @{DruidInstance}
-- @tparam bool is_debug
-- @tparam boolean|nil is_debug
-- @treturn self @{DruidInstance}
-- @local
function DruidInstance.set_debug(self, is_debug)
@ -530,7 +531,7 @@ end
--- Log message, if is_debug mode is enabled
-- @tparam DruidInstance self @{DruidInstance}
-- @tparam string message
-- @tparam[opt] table context
-- @tparam table|nil context
-- @local
function DruidInstance.log_message(self, message, context)
if not self._is_debug then
@ -558,10 +559,10 @@ end
--- Create @{Button} component
-- @tparam DruidInstance self
-- @tparam node node GUI node
-- @tparam function callback Button callback
-- @tparam[opt] table params Button callback params
-- @tparam[opt] node anim_node Button anim node (node, if not provided)
-- @tparam string|node node The node_id or gui.get_node(node_id)
-- @tparam function|nil callback Button callback
-- @tparam table|nil params Button callback params
-- @tparam node|nil anim_node Button anim node (node, if not provided)
-- @treturn Button @{Button} component
function DruidInstance.new_button(self, node, callback, params, anim_node)
return DruidInstance.new(self, button, node, callback, params, anim_node)
@ -570,7 +571,7 @@ end
--- Create @{Blocker} component
-- @tparam DruidInstance self
-- @tparam node node Gui node
-- @tparam string|node node The node_id or gui.get_node(node_id)
-- @treturn Blocker @{Blocker} component
function DruidInstance.new_blocker(self, node)
return DruidInstance.new(self, blocker, node)
@ -579,8 +580,8 @@ end
--- Create @{BackHandler} component
-- @tparam DruidInstance self
-- @tparam callback callback On back button
-- @tparam[opt] any params Callback argument
-- @tparam function|nil callback @The callback(self, custom_args) to call on back event
-- @tparam any|nil params Callback argument
-- @treturn BackHandler @{BackHandler} component
function DruidInstance.new_back_handler(self, callback, params)
return DruidInstance.new(self, back_handler, callback, params)
@ -589,8 +590,8 @@ end
--- Create @{Hover} component
-- @tparam DruidInstance self
-- @tparam node node Gui node
-- @tparam function on_hover_callback Hover callback
-- @tparam string|node node The node_id or gui.get_node(node_id)
-- @tparam function|nil on_hover_callback Hover callback
-- @treturn Hover @{Hover} component
function DruidInstance.new_hover(self, node, on_hover_callback)
return DruidInstance.new(self, hover, node, on_hover_callback)
@ -599,9 +600,9 @@ end
--- Create @{Text} component
-- @tparam DruidInstance self
-- @tparam node node Gui text node
-- @tparam[opt] string value Initial text. Default value is node text from GUI scene.
-- @tparam[opt] bool no_adjust If true, text will be not auto-adjust size
-- @tparam string|node node The node_id or gui.get_node(node_id)
-- @tparam string|nil value Initial text. Default value is node text from GUI scene.
-- @tparam boolean|nil no_adjust If true, text will be not auto-adjust size
-- @treturn Text @{Text} component
function DruidInstance.new_text(self, node, value, no_adjust)
return DruidInstance.new(self, text, node, value, no_adjust)
@ -611,32 +612,32 @@ end
--- Create @{StaticGrid} component
-- Deprecated
-- @tparam DruidInstance self
-- @tparam node parent The gui node parent, where items will be placed
-- @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 string|node parent_node The node_id or gui.get_node(node_id). Parent of all Grid items.
-- @tparam node item Element prefab. Required to get grid's item size. Can be adjusted separately.
-- @tparam number|nil in_row How many nodes in row can be placed
-- @treturn StaticGrid @{StaticGrid} component
-- @local
function DruidInstance.new_grid(self, parent, element, in_row)
function DruidInstance.new_grid(self, parent_node, item, in_row)
helper.deprecated("The druid:new_grid is deprecated. Please use druid:new_static_grid instead")
return DruidInstance.new(self, static_grid, parent, element, in_row)
return DruidInstance.new(self, static_grid, parent_node, item, in_row)
end
--- Create @{StaticGrid} component
-- @tparam DruidInstance self
-- @tparam node parent The gui node parent, where items will be placed
-- @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 string|node parent_node The node_id or gui.get_node(node_id). Parent of all Grid items.
-- @tparam string|node item Item prefab. Required to get grid's item size. Can be adjusted separately.
-- @tparam number|nil in_row How many nodes in row can be placed
-- @treturn StaticGrid @{StaticGrid} component
function DruidInstance.new_static_grid(self, parent, element, in_row)
return DruidInstance.new(self, static_grid, parent, element, in_row)
function DruidInstance.new_static_grid(self, parent_node, item, in_row)
return DruidInstance.new(self, static_grid, parent_node, item, in_row)
end
--- Create @{Scroll} component
-- @tparam DruidInstance self
-- @tparam node view_node GUI view scroll node
-- @tparam node content_node GUI content scroll node
-- @tparam string|node view_node The node_id or gui.get_node(node_id). Will used as user input node.
-- @tparam string|node content_node The node_id or gui.get_node(node_id). Will used as scrollable node inside view_node.
-- @treturn Scroll @{Scroll} component
function DruidInstance.new_scroll(self, view_node, content_node)
return DruidInstance.new(self, scroll, view_node, content_node)
@ -645,8 +646,8 @@ end
--- Create @{Drag} component
-- @tparam DruidInstance self
-- @tparam node node GUI node to detect dragging
-- @tparam function on_drag_callback Callback for on_drag_event(self, dx, dy)
-- @tparam string|node node The node_id or gui.get_node(node_id). Will used as user input node.
-- @tparam function|nil on_drag_callback Callback for on_drag_event(self, dx, dy)
-- @treturn Drag @{Drag} component
function DruidInstance.new_drag(self, node, on_drag_callback)
return DruidInstance.new(self, drag, node, on_drag_callback)
@ -655,8 +656,8 @@ end
--- Create @{Swipe} component
-- @tparam DruidInstance self
-- @tparam node node Gui node
-- @tparam function on_swipe_callback Swipe callback for on_swipe_end event
-- @tparam string|node node The node_id or gui.get_node(node_id). Will used as user input node.
-- @tparam function|nil on_swipe_callback Swipe callback for on_swipe_end event
-- @treturn Swipe @{Swipe} component
function DruidInstance.new_swipe(self, node, on_swipe_callback)
return helper.require_component_message("swipe")
@ -665,41 +666,41 @@ end
--- Create @{DynamicGrid} component
-- @tparam DruidInstance self
-- @tparam node parent The gui node parent, where items will be placed
-- @tparam string|node parent_node The node_id or gui.get_node(node_id). Parent of all Grid items.
-- @treturn DynamicGrid @{DynamicGrid} component
function DruidInstance.new_dynamic_grid(self, parent)
function DruidInstance.new_dynamic_grid(self, parent_node)
return helper.require_component_message("dynamic_grid")
end
--- Create @{LangText} component
-- @tparam DruidInstance self
-- @tparam node node The text node
-- @tparam string locale_id Default locale id
-- @tparam bool no_adjust If true, will not correct text size
-- @tparam string|node node The_node id or gui.get_node(node_id)
-- @tparam string|nil locale_id Default locale id or text from node as default
-- @tparam string|nil adjust_type Adjust type for text node. Default: const.TEXT_ADJUST.DOWNSCALE
-- @treturn LangText @{LangText} component
function DruidInstance.new_lang_text(self, node, locale_id, no_adjust)
function DruidInstance.new_lang_text(self, node, locale_id, adjust_type)
return helper.require_component_message("lang_text")
end
--- Create @{Slider} component
-- @tparam DruidInstance self
-- @tparam node node Gui pin node
-- @tparam string|node pin_node The_node id or gui.get_node(node_id).
-- @tparam vector3 end_pos The end position of slider
-- @tparam[opt] function callback On slider change callback
-- @tparam function|nil callback On slider change callback
-- @treturn Slider @{Slider} component
function DruidInstance.new_slider(self, node, end_pos, callback)
function DruidInstance.new_slider(self, pin_node, end_pos, callback)
return helper.require_component_message("slider")
end
--- Create @{Checkbox} component
-- @tparam DruidInstance self
-- @tparam node node Gui node
-- @tparam function callback Checkbox callback
-- @tparam[opt=node] node click_node Trigger node, by default equals to node
-- @tparam[opt=false] boolean initial_state The initial state of checkbox, default - false
-- @tparam string|node node The_node id or gui.get_node(node_id).
-- @tparam function|nil callback Checkbox callback
-- @tparam node|nil click_node Trigger node, Default: node
-- @tparam boolean|nil initial_state The initial state of checkbox, Default: false
-- @treturn Checkbox @{Checkbox} component
function DruidInstance.new_checkbox(self, node, callback, click_node, initial_state)
return helper.require_component_message("checkbox")
@ -708,9 +709,9 @@ end
--- Create @{Input} component
-- @tparam DruidInstance self
-- @tparam node click_node Button node to enabled input component
-- @tparam node text_node Text node what will be changed on user input
-- @tparam[opt] number keyboard_type Gui keyboard type for input field
-- @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 number|nil keyboard_type Gui keyboard type for input field
-- @treturn Input @{Input} component
function DruidInstance.new_input(self, click_node, text_node, keyboard_type)
return helper.require_component_message("input")
@ -731,7 +732,7 @@ end
--- Create @{DataList} component
-- @tparam DruidInstance self
-- @tparam Scroll druid_scroll The Scroll instance for Data List component
-- @tparam Grid druid_grid The Grid instance for Data List component
-- @tparam StaticGrid|DynamicGrid druid_grid The @{StaticGrid} or @{DynamicGrid} instance for Data List component
-- @tparam function create_function The create function callback(self, data, index, data_list). Function should return (node, [component])
-- @treturn DataList @{DataList} component
function DruidInstance.new_data_list(self, druid_scroll, druid_grid, create_function)
@ -752,10 +753,10 @@ end
--- Create @{Timer} component
-- @tparam DruidInstance self
-- @tparam node node Gui text node
-- @tparam string|node node Gui text node
-- @tparam number seconds_from Start timer value in seconds
-- @tparam[opt=0] number seconds_to End timer value in seconds
-- @tparam[opt] function callback Function on timer end
-- @tparam number|nil seconds_to End timer value in seconds
-- @tparam function|nil callback Function on timer end
-- @treturn Timer @{Timer} component
function DruidInstance.new_timer(self, node, seconds_from, seconds_to, callback)
return helper.require_component_message("timer")
@ -766,7 +767,7 @@ end
-- @tparam DruidInstance self
-- @tparam string|node node Progress bar fill node or node name
-- @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
-- @treturn Progress @{Progress} component
function DruidInstance.new_progress(self, node, key, init_value)
return helper.require_component_message("progress")
@ -775,7 +776,7 @@ end
--- Create @{Layout} component
-- @tparam DruidInstance self
-- @tparam string|node node Layout node
-- @tparam string|node node The_node id or gui.get_node(node_id).
-- @tparam string mode The layout mode
-- @treturn Layout @{Layout} component
function DruidInstance.new_layout(self, node, mode)
@ -786,10 +787,10 @@ end
--- Create @{Hotkey} component
-- @tparam DruidInstance self
-- @tparam string|string[] keys_array Keys for trigger action. Should contains one action key and any amount of modificator keys
-- @tparam function callback Button callback
-- @tparam[opt] value params Button callback params
-- @tparam function callback The callback function
-- @tparam any|nil callback_argument The argument to pass into the callback function
-- @treturn Hotkey @{Hotkey} component
function DruidInstance.new_hotkey(self, keys_array, callback, params)
function DruidInstance.new_hotkey(self, keys_array, callback, callback_argument)
return helper.require_component_message("hotkey")
end
@ -797,8 +798,8 @@ end
--- Create @{RichText} component.
-- As a template please check rich_text.gui layout.
-- @tparam DruidInstance self
-- @tparam[opt] string template Template name if used
-- @tparam[opt] table nodes Nodes table from gui.clone_tree
-- @tparam string|nil template Template name if used
-- @tparam table|nil nodes Nodes table from gui.clone_tree
-- @treturn RichText @{RichText} component
function DruidInstance.new_rich_text(self, template, nodes)
return helper.require_component_message("rich_text", "custom")

View File

@ -9,7 +9,7 @@ local M = {}
M.default_style = nil
function M.get_text(name, a, b, c, d, e, f)
function M.get_text(name, a, b, c, d, e, f, g)
return "[Druid]: locales not inited"
end

View File

@ -173,7 +173,7 @@ local function init_lobby(self)
self.lobby_grid:add(get_title(self, "Texts"))
self.lobby_grid:add(get_button(self, "Texts", "texts_general", "/texts/texts_general/texts_general.gui_script"))
self.lobby_grid:add(get_button(self, "Adjust types", "texts_adjust", "/texts/texts_adjust/texts_adjust.gui_script"))
self.lobby_grid:add(get_button(self, "Lang Text", "texts_lang_text", "/texts/texts_adjust/texts_lang_text.gui_script"))
self.lobby_grid:add(get_button(self, "Lang Text", "texts_lang_text", "/texts/lang_text/lang_text.gui_script"))
self.lobby_grid:add(get_title(self, "Scrolls"))
self.lobby_grid:add(get_button_disabled(self, "Nested scrolls", "scroll_scene"))

View File

@ -60,12 +60,16 @@ nodes {
z: 0.0
w: 0.0
}
clipping_mode: CLIPPING_MODE_NONE
clipping_mode: CLIPPING_MODE_STENCIL
clipping_visible: true
clipping_inverted: false
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -115,12 +119,16 @@ nodes {
z: 0.0
w: 0.0
}
clipping_mode: CLIPPING_MODE_STENCIL
clipping_mode: CLIPPING_MODE_NONE
clipping_visible: true
clipping_inverted: false
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -176,6 +184,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -231,6 +243,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -294,6 +310,10 @@ nodes {
template_node_child: false
text_leading: 1.0
text_tracking: 0.0
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -357,6 +377,10 @@ nodes {
template_node_child: false
text_leading: 1.0
text_tracking: 0.0
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -420,6 +444,10 @@ nodes {
template_node_child: false
text_leading: 1.0
text_tracking: 0.0
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -483,6 +511,10 @@ nodes {
template_node_child: false
text_leading: 1.0
text_tracking: 0.0
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -532,12 +564,16 @@ nodes {
z: 0.0
w: 0.0
}
clipping_mode: CLIPPING_MODE_STENCIL
clipping_mode: CLIPPING_MODE_NONE
clipping_visible: true
clipping_inverted: false
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -593,6 +629,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -648,6 +688,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -669,8 +713,8 @@ nodes {
w: 1.0
}
size {
x: 36.0
y: 36.0
x: 200.0
y: 100.0
z: 0.0
w: 1.0
}
@ -703,6 +747,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_AUTO
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -758,6 +806,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -813,6 +865,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -876,6 +932,10 @@ nodes {
template_node_child: false
text_leading: 1.0
text_tracking: 0.0
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -931,6 +991,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -986,6 +1050,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -1041,6 +1109,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -1096,6 +1168,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -1162,6 +1238,10 @@ nodes {
template_node_child: false
text_leading: 1.0
text_tracking: 0.0
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -1217,6 +1297,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -1272,6 +1356,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -1338,6 +1426,10 @@ nodes {
template_node_child: false
text_leading: 1.0
text_tracking: 0.0
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -1393,6 +1485,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -1448,6 +1544,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -1514,6 +1614,10 @@ nodes {
template_node_child: false
text_leading: 1.0
text_tracking: 0.0
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -1569,6 +1673,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -1624,6 +1732,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -1679,6 +1791,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -1734,6 +1850,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -1789,6 +1909,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -1844,6 +1968,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -1899,6 +2027,10 @@ nodes {
alpha: 1.0
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -1962,6 +2094,10 @@ nodes {
template_node_child: false
text_leading: 1.0
text_tracking: 0.0
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -2017,6 +2153,10 @@ nodes {
alpha: 0.5
template_node_child: false
size_mode: SIZE_MODE_MANUAL
custom_type: 0
enabled: true
visible: true
material: ""
}
nodes {
position {
@ -2080,6 +2220,10 @@ nodes {
template_node_child: false
text_leading: 1.0
text_tracking: 0.0
custom_type: 0
enabled: true
visible: true
material: ""
}
layers {
name: "image"

View File

@ -17,7 +17,6 @@ local function init_scroll_with_grid(self)
local position = gui.get_position(clone_prefab["grid_prefab"])
grid_scroll:scroll_to(position)
end)
button:set_click_zone(gui.get_node("scroll_with_grid_size"))
end
gui.set_enabled(prefab, false)

View File

@ -8,7 +8,7 @@ use_latest_bob=false
enable_incremental_version=true
# You can point bob version for project in format "filename:sha"
bob_sha="1.4.7:7a608d3ce6ed895d484956c1e76110ed8b78422a"
bob_sha="1.6.0:d9e9c49ab946c058f29a8b688c862d70f30e9c43"
# Select Defold channel. Values: stable, beta, alpha
bob_channel="stable"

View File

@ -1,10 +1,5 @@
-- Manual Annotations --
---@class druid.rich_text.style
---@field COLORS table
---@field ADJUST_STEPS number
---@field ADJUST_SCALE_DELTA number
---@class druid.rich_text.metrics
---@field width number
---@field height number
@ -18,7 +13,7 @@
---@field lines table<number, druid.rich_text.metrics>
---@class druid.rich_text.word
---@field node Node
---@field node node
---@field relative_scale number
---@field color vector4
---@field position vector3
@ -26,7 +21,7 @@
---@field scale vector3
---@field size vector3
---@field metrics druid.rich_text.metrics
---@field pivot Pivot
---@field pivot number @ The gui.PIVOT_* constant
---@field text string
---@field shadow vector4
---@field outline vector4
@ -37,14 +32,14 @@
---@field br boolean
---@field nobr boolean
---@class druid.rich_text.word.image
---@class druid.rich_text.image
---@field texture string
---@field anim string
---@field width number
---@field height number
---@class druid.rich_text.settings
---@field parent Node
---@field parent node
---@field size number
---@field fonts table<string, string>
---@field color vector4
@ -54,8 +49,8 @@
---@field image_pixel_grid_snap boolean
---@field combine_words boolean
---@field default_animation string
---@field node_prefab Node
---@field text_prefab Node
---@field node_prefab node
---@field text_prefab node
---@class GUITextMetrics
---@field width number