Update documentation

This commit is contained in:
Insality 2020-10-12 00:30:03 +03:00
parent 50d0293097
commit cebba9a1a3
48 changed files with 6115 additions and 7745 deletions

View File

@ -31,40 +31,29 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="modules/druid.button.html">druid.button</a></li>
<li><a href="modules/druid.drag.html">druid.drag</a></li>
<li><a href="modules/druid.hover.html">druid.hover</a></li>
<li><a href="modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="modules/druid.text.html">druid.text</a></li>
<li><a href="modules/component.html">component</a></li>
<li><a href="modules/BackHandler.html">BackHandler</a></li>
<li><a href="modules/Blocker.html">Blocker</a></li>
<li><a href="modules/Button.html">Button</a></li>
<li><a href="modules/Drag.html">Drag</a></li>
<li><a href="modules/Hover.html">Hover</a></li>
<li><a href="modules/Scroll.html">Scroll</a></li>
<li><a href="modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="modules/Swipe.html">Swipe</a></li>
<li><a href="modules/Text.html">Text</a></li>
<li><a href="modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="modules/druid.html">druid</a></li>
<li><a href="modules/druid_event.html">druid_event</a></li>
<li><a href="modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="modules/druid.input.html">druid.input</a></li>
<li><a href="modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="modules/druid.progress.html">druid.progress</a></li>
<li><a href="modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="modules/druid.slider.html">druid.slider</a></li>
<li><a href="modules/druid.timer.html">druid.timer</a></li>
<li><a href="modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="modules/Checkbox.html">Checkbox</a></li>
<li><a href="modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="modules/Input.html">Input</a></li>
<li><a href="modules/LangText.html">LangText</a></li>
<li><a href="modules/Progress.html">Progress</a></li>
<li><a href="modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="modules/Slider.html">Slider</a></li>
<li><a href="modules/Timer.html">Timer</a></li>
<li><a href="modules/druid.helper.html">druid.helper</a></li>
<li><a href="modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="topics/01-components.md.html">01-components</a></li>
<li><a href="topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="topics/03-styles.md.html">Styles</a></li>
<li><a href="topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="topics/05-examples.md.html">Examples</a></li>
<li><a href="topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="topics/faq.md.html">faq</a></li>
<li><a href="topics/README.md.html">README</a></li>
<li><a href="modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
@ -77,43 +66,43 @@
<h2>Modules</h2>
<table class="module_list">
<tr>
<td class="name" nowrap><a href="modules/druid.back_handler.html">druid.back_handler</a></td>
<td class="name" nowrap><a href="modules/BackHandler.html">BackHandler</a></td>
<td class="summary">Component to handle back key (android, backspace)</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.blocker.html">druid.blocker</a></td>
<td class="name" nowrap><a href="modules/Blocker.html">Blocker</a></td>
<td class="summary">Component to block input on specify zone by node</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.button.html">druid.button</a></td>
<td class="name" nowrap><a href="modules/Button.html">Button</a></td>
<td class="summary">Component to handle basic GUI button</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.drag.html">druid.drag</a></td>
<td class="name" nowrap><a href="modules/Drag.html">Drag</a></td>
<td class="summary">Component to handle drag action on node.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.hover.html">druid.hover</a></td>
<td class="name" nowrap><a href="modules/Hover.html">Hover</a></td>
<td class="summary">Component to handle hover node interaction</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.scroll.html">druid.scroll</a></td>
<td class="name" nowrap><a href="modules/Scroll.html">Scroll</a></td>
<td class="summary">Component to handle scroll content.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.static_grid.html">druid.static_grid</a></td>
<td class="name" nowrap><a href="modules/StaticGrid.html">StaticGrid</a></td>
<td class="summary">Component to handle placing components by row and columns.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.swipe.html">druid.swipe</a></td>
<td class="name" nowrap><a href="modules/Swipe.html">Swipe</a></td>
<td class="summary">Component to handle swipe gestures on node.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.text.html">druid.text</a></td>
<td class="name" nowrap><a href="modules/Text.html">Text</a></td>
<td class="summary">Component to handle all GUI texts.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/component.html">component</a></td>
<td class="name" nowrap><a href="modules/BaseComponent.html">BaseComponent</a></td>
<td class="summary">Basic class for all Druid components.</td>
</tr>
<tr>
@ -121,44 +110,44 @@
<td class="summary">Druid UI Library.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid_event.html">druid_event</a></td>
<td class="name" nowrap><a href="modules/DruidEvent.html">DruidEvent</a></td>
<td class="summary">Lua event small library</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.checkbox.html">druid.checkbox</a></td>
<td class="name" nowrap><a href="modules/Checkbox.html">Checkbox</a></td>
<td class="summary">Druid checkbox component</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.checkbox_group.html">druid.checkbox_group</a></td>
<td class="name" nowrap><a href="modules/CheckboxGroup.html">CheckboxGroup</a></td>
<td class="summary">Checkbox group module</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.dynamic_grid.html">druid.dynamic_grid</a></td>
<td class="name" nowrap><a href="modules/DynamicGrid.html">DynamicGrid</a></td>
<td class="summary">Component to handle placing components in row</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.input.html">druid.input</a></td>
<td class="name" nowrap><a href="modules/Input.html">Input</a></td>
<td class="summary">Druid input text component.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.lang_text.html">druid.lang_text</a></td>
<td class="name" nowrap><a href="modules/LangText.html">LangText</a></td>
<td class="summary">Component to handle all GUI texts
Good working with localization system</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.progress.html">druid.progress</a></td>
<td class="name" nowrap><a href="modules/Progress.html">Progress</a></td>
<td class="summary">Basic progress bar component.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.radio_group.html">druid.radio_group</a></td>
<td class="name" nowrap><a href="modules/RadioGroup.html">RadioGroup</a></td>
<td class="summary">Radio group module</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.slider.html">druid.slider</a></td>
<td class="name" nowrap><a href="modules/Slider.html">Slider</a></td>
<td class="summary">Druid slider component</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid.timer.html">druid.timer</a></td>
<td class="name" nowrap><a href="modules/Timer.html">Timer</a></td>
<td class="summary">Component to handle GUI timers.</td>
</tr>
<tr>
@ -166,51 +155,16 @@
<td class="summary">Text node or icon node can be nil</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/druid_instance.html">druid_instance</a></td>
<td class="name" nowrap><a href="modules/DruidInstance.html">DruidInstance</a></td>
<td class="summary">Instance of Druid.</td>
</tr>
</table>
<h2>Topics</h2>
<table class="module_list">
<tr>
<td class="name" nowrap><a href="topics/01-components.md.html">01-components.md</a></td>
<td class="summary"></td>
</tr>
<tr>
<td class="name" nowrap><a href="topics/02-creating_custom_components.md.html">02-creating_custom_components.md</a></td>
<td class="summary"></td>
</tr>
<tr>
<td class="name" nowrap><a href="topics/03-styles.md.html">03-styles.md</a></td>
<td class="summary"></td>
</tr>
<tr>
<td class="name" nowrap><a href="topics/04-druid_assets.md.html">04-druid_assets.md</a></td>
<td class="summary"></td>
</tr>
<tr>
<td class="name" nowrap><a href="topics/05-examples.md.html">05-examples.md</a></td>
<td class="summary"></td>
</tr>
<tr>
<td class="name" nowrap><a href="topics/changelog.md.html">changelog.md</a></td>
<td class="summary"></td>
</tr>
<tr>
<td class="name" nowrap><a href="topics/faq.md.html">faq.md</a></td>
<td class="summary"></td>
</tr>
<tr>
<td class="name" nowrap><a href="topics/README.md.html">README.md</a></td>
<td class="summary"></td>
</tr>
</table>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -0,0 +1,196 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><strong>BackHandler</strong></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>BackHandler</code></h1>
<p>Component to handle back key (android, backspace)</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(self, callback[, params])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_input">on_input(self, action_id, action)</a></td>
<td class="summary">Input handler for component</td>
</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#on_back">on_back</a></td>
<td class="summary">On back handler callback(self, params)</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(self, callback[, params])</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">BackHandler</span></span>
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">callback</span></span>
On back button
</li>
<li><span class="parameter">params</span>
<span class="types"><span class="type">any</span></span>
Callback argument
(<em>optional</em>)
</li>
</ul>
</dd>
<dt>
<a name = "on_input"></a>
<strong>on_input(self, action_id, action)</strong>
</dt>
<dd>
Input handler for component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">BackHandler</span></span>
</li>
<li><span class="parameter">action_id</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
on_input action id
</li>
<li><span class="parameter">action</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
on_input action
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "on_back"></a>
<strong>on_back</strong>
</dt>
<dd>
On back handler callback(self, params)
<ul>
<li><span class="parameter">on_back</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -0,0 +1,479 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><strong>BaseComponent</strong></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>BaseComponent</code></h1>
<p>Basic class for all Druid components.</p>
<p>
To create you component, use `component.create`</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<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="#set_template">set_template(self, template)</a></td>
<td class="summary">Set current component template name</td>
</tr>
<tr>
<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="#get_context">get_context(self)</a></td>
<td class="summary">Get current component context</td>
</tr>
<tr>
<td class="name" nowrap><a href="#increase_input_priority">increase_input_priority(self)</a></td>
<td class="summary">Increase input priority in current input stack</td>
</tr>
<tr>
<td class="name" nowrap><a href="#reset_input_priority">reset_input_priority(self)</a></td>
<td class="summary">Reset input priority in current input stack</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_node">get_node(self, node_or_name)</a></td>
<td class="summary">Get node for component by name.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_druid">get_druid(self)</a></td>
<td class="summary">Return druid with context of calling component.</td>
</tr>
<tr>
<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="#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="#get_parent_component">get_parent_component(self)</a></td>
<td class="summary">Return the parent for current component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#setup_component">setup_component(self, druid_instance, context, style)</a></td>
<td class="summary">Setup component context and his style table</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "set_style"></a>
<strong>set_style(self, druid_style)</strong>
</dt>
<dd>
Set current component style table.
Invoke `on_style_change` on component, if exist. BaseComponent should handle
their style changing and store all style params
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">BaseComponent</span></span>
</li>
<li><span class="parameter">druid_style</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Druid style module
</li>
</ul>
</dd>
<dt>
<a name = "set_template"></a>
<strong>set_template(self, template)</strong>
</dt>
<dd>
Set current component template name
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">BaseComponent</span></span>
</li>
<li><span class="parameter">template</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
BaseComponent template name
</li>
</ul>
</dd>
<dt>
<a name = "set_nodes"></a>
<strong>set_nodes(self, nodes)</strong>
</dt>
<dd>
Set current component nodes
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">BaseComponent</span></span>
</li>
<li><span class="parameter">nodes</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
BaseComponent nodes table
</li>
</ul>
</dd>
<dt>
<a name = "get_context"></a>
<strong>get_context(self)</strong>
</dt>
<dd>
Get current component context
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">BaseComponent</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
BaseComponent context
</ol>
</dd>
<dt>
<a name = "increase_input_priority"></a>
<strong>increase_input_priority(self)</strong>
</dt>
<dd>
Increase input priority in current input stack
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">BaseComponent</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "reset_input_priority"></a>
<strong>reset_input_priority(self)</strong>
</dt>
<dd>
Reset input priority in current input stack
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">BaseComponent</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "get_node"></a>
<strong>get_node(self, node_or_name)</strong>
</dt>
<dd>
Get node for component by name.
If component has nodes, node_or_name should be string
It auto pick node by template name or from nodes by clone_tree
if they was setup via component:set_nodes, component:set_template
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">BaseComponent</span></span>
</li>
<li><span class="parameter">node_or_name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a> or <span class="type">node</span></span>
Node name or node itself
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">node</span></span>
Gui node
</ol>
</dd>
<dt>
<a name = "get_druid"></a>
<strong>get_druid(self)</strong>
</dt>
<dd>
Return druid with context of calling component.
Use it to create component inside of other components.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">BaseComponent</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Druid</span></span>
Druid instance with component context
</ol>
</dd>
<dt>
<a name = "get_name"></a>
<strong>get_name(self)</strong>
</dt>
<dd>
Return component name
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">BaseComponent</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
The component name
</ol>
</dd>
<dt>
<a name = "set_input_enabled"></a>
<strong>set_input_enabled(self, state)</strong>
</dt>
<dd>
Set component input state. By default it enabled
You can disable any input of component by this function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">BaseComponent</span></span>
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
The component input state
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">BaseComponent</span></span>
BaseComponent itself
</ol>
</dd>
<dt>
<a name = "get_parent_component"></a>
<strong>get_parent_component(self)</strong>
</dt>
<dd>
Return the parent for current component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">BaseComponent</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">druid.base_component</span> or <span class="type">nil</span></span>
The druid component instance or nil
</ol>
</dd>
<dt>
<a name = "setup_component"></a>
<strong>setup_component(self, druid_instance, context, style)</strong>
</dt>
<dd>
Setup component context and his style table
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">BaseComponent</span></span>
</li>
<li><span class="parameter">druid_instance</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
The parent druid instance
</li>
<li><span class="parameter">context</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Druid context. Usually it is self of script
</li>
<li><span class="parameter">style</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Druid style module
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">component</span></span>
BaseComponent itself
</ol>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

186
docs/modules/Blocker.html Normal file
View File

@ -0,0 +1,186 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><strong>Blocker</strong></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>Blocker</code></h1>
<p>Component to block input on specify zone by node</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(self, node)</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_enabled">set_enabled(self, state)</a></td>
<td class="summary">Set enabled blocker component state</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_enabled">is_enabled(self)</a></td>
<td class="summary">Return blocked enabled state</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(self, node)</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Blocker</span></span>
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
</ul>
</dd>
<dt>
<a name = "set_enabled"></a>
<strong>set_enabled(self, state)</strong>
</dt>
<dd>
Set enabled blocker component state
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Blocker</span></span>
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
Enabled state
</li>
</ul>
</dd>
<dt>
<a name = "is_enabled"></a>
<strong>is_enabled(self)</strong>
</dt>
<dd>
Return blocked enabled state
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Blocker</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
True, if blocker is enabled
</ol>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -34,100 +34,135 @@
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><strong>druid.button</strong></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><strong>Button</strong></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.button</code></h1>
<h1>Module <code>Button</code></h1>
<p>Component to handle basic GUI button</p>
<p>
</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, callback[, params[, anim_node]])</a></td>
<td class="name" nowrap><a href="#init">init(self, node, callback[, params[, anim_node]])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_enabled">set_enabled(state)</a></td>
<td class="name" nowrap><a href="#set_enabled">set_enabled(self, state)</a></td>
<td class="summary">Set enabled button component state</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_enabled">is_enabled()</a></td>
<td class="name" nowrap><a href="#is_enabled">is_enabled(self)</a></td>
<td class="summary">Return button enabled state</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_click_zone">set_click_zone(zone)</a></td>
<td class="name" nowrap><a href="#set_click_zone">set_click_zone(self, zone)</a></td>
<td class="summary">Strict button click area.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_key_trigger">set_key_trigger(key)</a></td>
<td class="name" nowrap><a href="#set_key_trigger">set_key_trigger(self, key)</a></td>
<td class="summary">Set key-code to trigger this button</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_key_trigger">get_key_trigger()</a></td>
<td class="name" nowrap><a href="#get_key_trigger">get_key_trigger(self)</a></td>
<td class="summary">Get key-code to trigger this button</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Style">Style</a></td>
<td class="name" nowrap><a href="#style">style</a></td>
<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="#on_click">on_click</a></td>
<td class="summary">On release button callback(self, params, button_instance)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_repeated_click">on_repeated_click</a></td>
<td class="summary">On repeated action button callback(self, params, button_instance, click_amount)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_long_click">on_long_click</a></td>
<td class="summary">On long tap button callback(self, params, button_instance, time)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_double_click">on_double_click</a></td>
<td class="summary">On double tap button callback(self, params, button_instance, click_amount)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_hold_callback">on_hold_callback</a></td>
<td class="summary">On button hold before long_click callback(self, params, button_instance, time)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_click_outside">on_click_outside</a></td>
<td class="summary">On click outside of button(self, params, button_instance)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#node">node</a></td>
<td class="summary">Trigger node</td>
</tr>
<tr>
<td class="name" nowrap><a href="#anim_node">anim_node</a></td>
<td class="summary">Animation node</td>
</tr>
<tr>
<td class="name" nowrap><a href="#start_scale">start_scale</a></td>
<td class="summary">Initial scale of anim_node</td>
</tr>
<tr>
<td class="name" nowrap><a href="#start_pos">start_pos</a></td>
<td class="summary">Initial pos of anim_node</td>
</tr>
<tr>
<td class="name" nowrap><a href="#pos">pos</a></td>
<td class="summary">Initial pos of anim_node</td>
</tr>
<tr>
<td class="name" nowrap><a href="#params">params</a></td>
<td class="summary">Params to click callbacks</td>
</tr>
<tr>
<td class="name" nowrap><a href="#hover">hover</a></td>
<td class="summary">Druid hover logic component</td>
</tr>
</table>
<br/>
<br/>
@ -138,7 +173,7 @@
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, callback[, params[, anim_node]])</strong>
<strong>init(self, node, callback[, params[, anim_node]])</strong>
</dt>
<dd>
Component init function
@ -146,8 +181,12 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Button</span></span>
</li>
<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>
Gui node
</li>
<li><span class="parameter">callback</span>
@ -160,7 +199,7 @@
(<em>optional</em>)
</li>
<li><span class="parameter">anim_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>
Button anim node (node, if not provided)
(<em>optional</em>)
</li>
@ -173,7 +212,7 @@
</dd>
<dt>
<a name = "set_enabled"></a>
<strong>set_enabled(state)</strong>
<strong>set_enabled(self, state)</strong>
</dt>
<dd>
Set enabled button component state
@ -181,6 +220,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Button</span></span>
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
Enabled state
@ -190,7 +233,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">druid.button</span></span>
<span class="types"><span class="type">Button</span></span>
Current button instance
</ol>
@ -200,12 +243,19 @@
</dd>
<dt>
<a name = "is_enabled"></a>
<strong>is_enabled()</strong>
<strong>is_enabled(self)</strong>
</dt>
<dd>
Return button enabled state
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Button</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
@ -220,7 +270,7 @@
</dd>
<dt>
<a name = "set_click_zone"></a>
<strong>set_click_zone(zone)</strong>
<strong>set_click_zone(self, zone)</strong>
</dt>
<dd>
Strict button click area. Useful for
@ -229,8 +279,12 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Button</span></span>
</li>
<li><span class="parameter">zone</span>
<span class="types"><span class="type">node</span></span>
<span class="types"><a class="type" href="../modules/Button.html#node">node</a></span>
Gui node
</li>
</ul>
@ -238,7 +292,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">druid.button</span></span>
<span class="types"><span class="type">Button</span></span>
Current button instance
</ol>
@ -248,7 +302,7 @@
</dd>
<dt>
<a name = "set_key_trigger"></a>
<strong>set_key_trigger(key)</strong>
<strong>set_key_trigger(self, key)</strong>
</dt>
<dd>
Set key-code to trigger this button
@ -256,6 +310,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Button</span></span>
</li>
<li><span class="parameter">key</span>
<span class="types"><span class="type">hash</span></span>
The action_id of the key
@ -265,7 +323,7 @@
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">druid.button</span></span>
<span class="types"><span class="type">Button</span></span>
Current button instance
</ol>
@ -275,12 +333,19 @@
</dd>
<dt>
<a name = "get_key_trigger"></a>
<strong>get_key_trigger()</strong>
<strong>get_key_trigger(self)</strong>
</dt>
<dd>
Get key-code to trigger this button
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Button</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
@ -298,100 +363,8 @@
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_click</span>
<span class="types"><span class="type">druid_event</span></span>
(self, params, button_instance) On release button callback
</li>
<li><span class="parameter">on_repeated_click</span>
<span class="types"><span class="type">druid_event</span></span>
(self, params, button<em>instance, click</em>amount) On repeated action button callback
</li>
<li><span class="parameter">on_long_click</span>
<span class="types"><span class="type">druid_event</span></span>
(self, params, button_instance, time) On long tap button callback
</li>
<li><span class="parameter">on_double_click</span>
<span class="types"><span class="type">druid_event</span></span>
(self, params, button<em>instance, click</em>amount) On double tap button callback
</li>
<li><span class="parameter">on_hold_callback</span>
<span class="types"><span class="type">druid_event</span></span>
(self, params, button<em>instance, time) On button hold before long</em>click callback
</li>
<li><span class="parameter">on_click_outside</span>
<span class="types"><span class="type">druid_event</span></span>
(self, params, button_instance) On click outside of button
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Trigger node
</li>
<li><span class="parameter">anim_node</span>
<span class="types"><span class="type">node</span></span>
Animation node
(<em>default</em> node)
</li>
<li><span class="parameter">start_scale</span>
<span class="types"><span class="type">vector3</span></span>
Initial scale of anim_node
</li>
<li><span class="parameter">start_pos</span>
<span class="types"><span class="type">vector3</span></span>
Initial pos of anim_node
</li>
<li><span class="parameter">pos</span>
<span class="types"><span class="type">vector3</span></span>
Initial pos of anim_node
</li>
<li><span class="parameter">params</span>
<span class="types"><span class="type">any</span></span>
Params to click callbacks
</li>
<li><span class="parameter">hover</span>
<span class="types"><span class="type">druid.hover</span></span>
Druid hover logic component
</li>
<li><span class="parameter">click_zone</span>
<span class="types"><span class="type">node</span></span>
Restriction zone
(<em>optional</em>)
</li>
</ul>
</dd>
<dt>
<a name = "Style"></a>
<strong>Style</strong>
<a name = "style"></a>
<strong>style</strong>
</dt>
<dd>
Component style params.
@ -403,7 +376,7 @@
<ul>
<li><span class="parameter">LONGTAP_TIME</span>
<span class="types"><span class="type">number</span></span>
Minimum time to trigger on<em>hold</em>callback
Minimum time to trigger on_hold_callback
(<em>default</em> 0.4)
</li>
<li><span class="parameter">AUTOHOLD_TRIGGER</span>
@ -442,6 +415,271 @@
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "on_click"></a>
<strong>on_click</strong>
</dt>
<dd>
On release button callback(self, params, button_instance)
<ul>
<li><span class="parameter">on_click</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_repeated_click"></a>
<strong>on_repeated_click</strong>
</dt>
<dd>
On repeated action button callback(self, params, button_instance, click_amount)
<ul>
<li><span class="parameter">on_repeated_click</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_long_click"></a>
<strong>on_long_click</strong>
</dt>
<dd>
On long tap button callback(self, params, button_instance, time)
<ul>
<li><span class="parameter">on_long_click</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_double_click"></a>
<strong>on_double_click</strong>
</dt>
<dd>
On double tap button callback(self, params, button_instance, click_amount)
<ul>
<li><span class="parameter">on_double_click</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_hold_callback"></a>
<strong>on_hold_callback</strong>
</dt>
<dd>
On button hold before long_click callback(self, params, button_instance, time)
<ul>
<li><span class="parameter">on_hold_callback</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_click_outside"></a>
<strong>on_click_outside</strong>
</dt>
<dd>
On click outside of button(self, params, button_instance)
<ul>
<li><span class="parameter">on_click_outside</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "node"></a>
<strong>node</strong>
</dt>
<dd>
Trigger node
<ul>
<li><span class="parameter">node</span>
<span class="types"><a class="type" href="../modules/Button.html#node">node</a></span>
</li>
</ul>
</dd>
<dt>
<a name = "anim_node"></a>
<strong>anim_node</strong>
</dt>
<dd>
Animation node
<ul>
<li><span class="parameter">anim_node</span>
<span class="types"><a class="type" href="../modules/Button.html#node">node</a></span>
(<em>default</em> node)
</li>
</ul>
</dd>
<dt>
<a name = "start_scale"></a>
<strong>start_scale</strong>
</dt>
<dd>
Initial scale of anim_node
<ul>
<li><span class="parameter">start_scale</span>
<span class="types"><span class="type">vector3</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "start_pos"></a>
<strong>start_pos</strong>
</dt>
<dd>
Initial pos of anim_node
<ul>
<li><span class="parameter">start_pos</span>
<span class="types"><span class="type">vector3</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "pos"></a>
<strong>pos</strong>
</dt>
<dd>
Initial pos of anim_node
<ul>
<li><span class="parameter">pos</span>
<span class="types"><span class="type">vector3</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "params"></a>
<strong>params</strong>
</dt>
<dd>
Params to click callbacks
<ul>
<li><span class="parameter">params</span>
<span class="types"><span class="type">any</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "hover"></a>
<strong>hover</strong>
</dt>
<dd>
Druid hover logic component
<ul>
<li><span class="parameter">hover</span>
<span class="types"><span class="type">druid.hover</span></span>
</li>
</ul>
</dd>
</dl>
@ -450,7 +688,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -34,88 +34,83 @@
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><strong>druid.checkbox</strong></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><strong>Checkbox</strong></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.checkbox</code></h1>
<h1>Module <code>Checkbox</code></h1>
<p>Druid checkbox component</p>
<p>
</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, callback[, click=node])</a></td>
<td class="name" nowrap><a href="#init">init(self, node, callback[, click_node=node])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_state">set_state(state, is_silent)</a></td>
<td class="name" nowrap><a href="#set_state">set_state(self, state, is_silent)</a></td>
<td class="summary">Set checkbox state</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_state">get_state()</a></td>
<td class="name" nowrap><a href="#get_state">get_state(self)</a></td>
<td class="summary">Return checkbox state</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Style">Style</a></td>
<td class="name" nowrap><a href="#style">style</a></td>
<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="#on_change_state">on_change_state</a></td>
<td class="summary">On change state callback(self, state)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#node">node</a></td>
<td class="summary">Visual node</td>
</tr>
<tr>
<td class="name" nowrap><a href="#click_node">click_node</a></td>
<td class="summary">Button trigger node</td>
</tr>
</table>
<br/>
<br/>
@ -126,7 +121,7 @@
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, callback[, click=node])</strong>
<strong>init(self, node, callback[, click_node=node])</strong>
</dt>
<dd>
Component init function
@ -134,17 +129,21 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Checkbox</span></span>
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
<span class="types"><a class="type" href="../modules/Checkbox.html#node">node</a></span>
Gui node
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Checkbox callback
</li>
<li><span class="parameter">click</span>
<span class="types"><span class="type">node</span></span>
node Trigger node, by default equals to node
<li><span class="parameter">click_node</span>
<span class="types"><a class="type" href="../modules/Checkbox.html#node">node</a></span>
Trigger node, by default equals to node
(<em>default</em> node)
</li>
</ul>
@ -156,7 +155,7 @@
</dd>
<dt>
<a name = "set_state"></a>
<strong>set_state(state, is_silent)</strong>
<strong>set_state(self, state, is_silent)</strong>
</dt>
<dd>
Set checkbox state
@ -164,13 +163,17 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Checkbox</span></span>
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
Checkbox state
</li>
<li><span class="parameter">is_silent</span>
<span class="types"><span class="type">bool</span></span>
Don't trigger on<em>change</em>state if true
Don't trigger on_change_state if true
</li>
</ul>
@ -181,12 +184,19 @@
</dd>
<dt>
<a name = "get_state"></a>
<strong>get_state()</strong>
<strong>get_state(self)</strong>
</dt>
<dd>
Return checkbox state
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Checkbox</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
@ -204,59 +214,8 @@
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_change_state</span>
<span class="types"><span class="type">druid_event</span></span>
On change state callback
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Visual node
</li>
<li><span class="parameter">click_node</span>
<span class="types"><span class="type">node</span></span>
Button trigger node
(<em>default</em> node)
</li>
<li><span class="parameter">button</span>
<span class="types"><span class="type">druid.button</span></span>
Button component from click_node
</li>
</ul>
</dd>
<dt>
<a name = "Style"></a>
<strong>Style</strong>
<a name = "style"></a>
<strong>style</strong>
</dt>
<dd>
Component style params.
@ -276,6 +235,71 @@
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "on_change_state"></a>
<strong>on_change_state</strong>
</dt>
<dd>
On change state callback(self, state)
<ul>
<li><span class="parameter">on_change_state</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "node"></a>
<strong>node</strong>
</dt>
<dd>
Visual node
<ul>
<li><span class="parameter">node</span>
<span class="types"><a class="type" href="../modules/Checkbox.html#node">node</a></span>
</li>
</ul>
</dd>
<dt>
<a name = "click_node"></a>
<strong>click_node</strong>
</dt>
<dd>
Button trigger node
<ul>
<li><span class="parameter">click_node</span>
<span class="types"><a class="type" href="../modules/Checkbox.html#node">node</a></span>
(<em>default</em> node)
</li>
</ul>
</dd>
</dl>
@ -284,7 +308,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -0,0 +1,227 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><strong>CheckboxGroup</strong></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>CheckboxGroup</code></h1>
<p>Checkbox group module</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(self, nodes, callback[, click_nodes=node])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_state">set_state(self, indexes)</a></td>
<td class="summary">Set checkbox group state</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_state">get_state(self)</a></td>
<td class="summary">Return checkbox group state</td>
</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#on_checkbox_click">on_checkbox_click</a></td>
<td class="summary">On any checkbox click callback(self, index)</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(self, nodes, callback[, click_nodes=node])</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">CheckboxGroup</span></span>
</li>
<li><span class="parameter">nodes</span>
<span class="types"><span class="type">node[]</span></span>
Array of gui node
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Checkbox callback
</li>
<li><span class="parameter">click_nodes</span>
<span class="types"><span class="type">node[]</span></span>
Array of trigger nodes, by default equals to nodes
(<em>default</em> node)
</li>
</ul>
</dd>
<dt>
<a name = "set_state"></a>
<strong>set_state(self, indexes)</strong>
</dt>
<dd>
Set checkbox group state
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">CheckboxGroup</span></span>
</li>
<li><span class="parameter">indexes</span>
<span class="types"><span class="type">bool[]</span></span>
Array of checkbox state
</li>
</ul>
</dd>
<dt>
<a name = "get_state"></a>
<strong>get_state(self)</strong>
</dt>
<dd>
Return checkbox group state
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">CheckboxGroup</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool[]</span></span>
Array if checkboxes state
</ol>
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "on_checkbox_click"></a>
<strong>on_checkbox_click</strong>
</dt>
<dd>
On any checkbox click callback(self, index)
<ul>
<li><span class="parameter">on_checkbox_click</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

471
docs/modules/Drag.html Normal file
View File

@ -0,0 +1,471 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><strong>Drag</strong></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>Drag</code></h1>
<p>Component to handle drag action on node.</p>
<p>
Drag have correct handling for multitouch and swap
touched while dragging. Drag will be processed even
the cursor is outside of node, if drag is already started</p>
<h2><a href="#Functions">Functions</a></h2>
<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>
</tr>
<tr>
<td class="name" nowrap><a href="#set_click_zone">set_click_zone(self, zone)</a></td>
<td class="summary">Strict drag click area.</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#style">style</a></td>
<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="#on_touch_start">on_touch_start</a></td>
<td class="summary">Event on touch start callback(self)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_touch_end">on_touch_end</a></td>
<td class="summary">Event on touch end callback(self)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_drag_start">on_drag_start</a></td>
<td class="summary">Event on drag start callback(self)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_drag">on_drag</a></td>
<td class="summary">on drag progress callback(self, dx, dy)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_drag_end">on_drag_end</a></td>
<td class="summary">Event on drag end callback(self)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_touch">is_touch</a></td>
<td class="summary">Is component now touching</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_drag">is_drag</a></td>
<td class="summary">Is component now dragging</td>
</tr>
<tr>
<td class="name" nowrap><a href="#can_x">can_x</a></td>
<td class="summary">Is drag component process vertical dragging.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#can_y">can_y</a></td>
<td class="summary">Is drag component process horizontal.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#x">x</a></td>
<td class="summary">Current touch x position</td>
</tr>
<tr>
<td class="name" nowrap><a href="#y">y</a></td>
<td class="summary">Current touch y position</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(self, node, on_drag_callback)</strong>
</dt>
<dd>
Drag component constructor
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Drag</span></span>
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
GUI node to detect dragging
</li>
<li><span class="parameter">on_drag_callback</span>
<span class="types"><span class="type">function</span></span>
Callback for on_drag_event(self, dx, dy)
</li>
</ul>
</dd>
<dt>
<a name = "set_click_zone"></a>
<strong>set_click_zone(self, zone)</strong>
</dt>
<dd>
Strict drag click area. Useful for
restrict events outside stencil node
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Drag</span></span>
</li>
<li><span class="parameter">zone</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "style"></a>
<strong>style</strong>
</dt>
<dd>
Component style params.
You can override this component styles params in druid styles table
or create your own style
<h3>Fields:</h3>
<ul>
<li><span class="parameter">DRAG_DEADZONE</span>
<span class="types"><span class="type">number</span></span>
Distance in pixels to start dragging
(<em>default</em> 10)
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "on_touch_start"></a>
<strong>on_touch_start</strong>
</dt>
<dd>
Event on touch start callback(self)
<ul>
<li><span class="parameter">on_touch_start</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_touch_end"></a>
<strong>on_touch_end</strong>
</dt>
<dd>
Event on touch end callback(self)
<ul>
<li><span class="parameter">on_touch_end</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_drag_start"></a>
<strong>on_drag_start</strong>
</dt>
<dd>
Event on drag start callback(self)
<ul>
<li><span class="parameter">on_drag_start</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_drag"></a>
<strong>on_drag</strong>
</dt>
<dd>
on drag progress callback(self, dx, dy)
<ul>
<li><span class="parameter">on_drag</span>
<span class="types"><span class="type">druid_event</span></span>
Event
</li>
</ul>
</dd>
<dt>
<a name = "on_drag_end"></a>
<strong>on_drag_end</strong>
</dt>
<dd>
Event on drag end callback(self)
<ul>
<li><span class="parameter">on_drag_end</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "is_touch"></a>
<strong>is_touch</strong>
</dt>
<dd>
Is component now touching
<ul>
<li><span class="parameter">is_touch</span>
<span class="types"><span class="type">bool</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "is_drag"></a>
<strong>is_drag</strong>
</dt>
<dd>
Is component now dragging
<ul>
<li><span class="parameter">is_drag</span>
<span class="types"><span class="type">bool</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "can_x"></a>
<strong>can_x</strong>
</dt>
<dd>
Is drag component process vertical dragging. Default - true
<ul>
<li><span class="parameter">can_x</span>
<span class="types"><span class="type">bool</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "can_y"></a>
<strong>can_y</strong>
</dt>
<dd>
Is drag component process horizontal. Default - true
<ul>
<li><span class="parameter">can_y</span>
<span class="types"><span class="type">bool</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "x"></a>
<strong>x</strong>
</dt>
<dd>
Current touch x position
<ul>
<li><span class="parameter">x</span>
<span class="types"><span class="type">number</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "y"></a>
<strong>y</strong>
</dt>
<dd>
Current touch y position
<ul>
<li><span class="parameter">y</span>
<span class="types"><span class="type">number</span></span>
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -38,77 +38,64 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><strong>druid_event</strong></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><strong>DruidEvent</strong></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid_event</code></h1>
<h1>Module <code>DruidEvent</code></h1>
<p>Lua event small library</p>
<p>
</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Event">Event(initial_callback)</a></td>
<td class="name" nowrap><a href="#initialize">initialize(self, initial_callback)</a></td>
<td class="summary">Event constructur</td>
</tr>
<tr>
<td class="name" nowrap><a href="#event:subscribe">event:subscribe(callback)</a></td>
<td class="name" nowrap><a href="#subscribe">subscribe(self, callback)</a></td>
<td class="summary">Subscribe callback on event</td>
</tr>
<tr>
<td class="name" nowrap><a href="#event:unsubscribe">event:unsubscribe(callback)</a></td>
<td class="name" nowrap><a href="#unsubscribe">unsubscribe(self, callback)</a></td>
<td class="summary">Unsubscribe callback on event</td>
</tr>
<tr>
<td class="name" nowrap><a href="#event:is_exist">event:is_exist()</a></td>
<td class="name" nowrap><a href="#is_exist">is_exist(self)</a></td>
<td class="summary">Return true, if event have at lease one handler</td>
</tr>
<tr>
<td class="name" nowrap><a href="#event:clear">event:clear()</a></td>
<td class="name" nowrap><a href="#clear">clear(self)</a></td>
<td class="summary">Clear the all event handlers</td>
</tr>
<tr>
<td class="name" nowrap><a href="#event:trigger">event:trigger(...)</a></td>
<td class="name" nowrap><a href="#trigger">trigger(self, ...)</a></td>
<td class="summary">Trigger the event and call all subscribed callbacks</td>
</tr>
</table>
@ -121,8 +108,8 @@
<dl class="function">
<dt>
<a name = "Event"></a>
<strong>Event(initial_callback)</strong>
<a name = "initialize"></a>
<strong>initialize(self, initial_callback)</strong>
</dt>
<dd>
Event constructur
@ -130,6 +117,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DruidEvent</span></span>
</li>
<li><span class="parameter">initial_callback</span>
<span class="types"><span class="type">function</span></span>
Subscribe the callback on new event, if callback exist
@ -142,8 +133,8 @@
</dd>
<dt>
<a name = "event:subscribe"></a>
<strong>event:subscribe(callback)</strong>
<a name = "subscribe"></a>
<strong>subscribe(self, callback)</strong>
</dt>
<dd>
Subscribe callback on event
@ -151,6 +142,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DruidEvent</span></span>
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Callback itself
@ -163,8 +158,8 @@
</dd>
<dt>
<a name = "event:unsubscribe"></a>
<strong>event:unsubscribe(callback)</strong>
<a name = "unsubscribe"></a>
<strong>unsubscribe(self, callback)</strong>
</dt>
<dd>
Unsubscribe callback on event
@ -172,6 +167,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DruidEvent</span></span>
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Callback itself
@ -184,13 +183,20 @@
</dd>
<dt>
<a name = "event:is_exist"></a>
<strong>event:is_exist()</strong>
<a name = "is_exist"></a>
<strong>is_exist(self)</strong>
</dt>
<dd>
Return true, if event have at lease one handler
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DruidEvent</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
@ -204,13 +210,20 @@
</dd>
<dt>
<a name = "event:clear"></a>
<strong>event:clear()</strong>
<a name = "clear"></a>
<strong>clear(self)</strong>
</dt>
<dd>
Clear the all event handlers
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DruidEvent</span></span>
</li>
</ul>
@ -218,8 +231,8 @@
</dd>
<dt>
<a name = "event:trigger"></a>
<strong>event:trigger(...)</strong>
<a name = "trigger"></a>
<strong>trigger(self, ...)</strong>
</dt>
<dd>
Trigger the event and call all subscribed callbacks
@ -227,7 +240,12 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DruidEvent</span></span>
</li>
<li><span class="parameter">...</span>
<span class="types"><span class="type">any</span></span>
All event params
</li>
</ul>
@ -244,7 +262,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

File diff suppressed because it is too large Load Diff

View File

@ -33,111 +33,130 @@
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><strong>druid.dynamic_grid</strong></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><strong>DynamicGrid</strong></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.dynamic_grid</code></h1>
<h1>Module <code>DynamicGrid</code></h1>
<p>Component to handle placing components in row</p>
<p>
</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(parent)</a></td>
<td class="name" nowrap><a href="#init">init(self, parent)</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_pos">get_pos(index, node)</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>
<td class="name" nowrap><a href="#add">add(node[, index[, is_shift_left=false]])</a></td>
<td class="name" nowrap><a href="#add">add(self, node[, index[, is_shift_left=false]])</a></td>
<td class="summary">Add new node to the grid</td>
</tr>
<tr>
<td class="name" nowrap><a href="#remove">remove(index[, is_shift_left=false])</a></td>
<td class="name" nowrap><a href="#remove">remove(self, index[, is_shift_left=false])</a></td>
<td class="summary">Remove the item from the grid.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_size">get_size()</a></td>
<td class="name" nowrap><a href="#get_size">get_size(self, border)</a></td>
<td class="summary">Return grid content size</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_index_by_node">get_index_by_node(node)</a></td>
<td class="name" nowrap><a href="#get_index_by_node">get_index_by_node(self, node)</a></td>
<td class="summary">Return grid index by node</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_all_pos">get_all_pos()</a></td>
<td class="name" nowrap><a href="#get_all_pos">get_all_pos(self)</a></td>
<td class="summary">Return array of all node positions</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_position_function">set_position_function(callback)</a></td>
<td class="name" nowrap><a href="#set_position_function">set_position_function(self, callback)</a></td>
<td class="summary">Change set position function for grid nodes.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#clear">clear()</a></td>
<td class="name" nowrap><a href="#clear">clear(self)</a></td>
<td class="summary">Clear grid nodes array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#DynamicGrid:_get_side_vector">DynamicGrid:_get_side_vector(side, is_forward)</a></td>
<td class="name" nowrap><a href="#_get_side_vector">_get_side_vector(self, side, is_forward)</a></td>
<td class="summary">Return side vector to correct node shifting</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
<td class="name" nowrap><a href="#on_add_item">on_add_item</a></td>
<td class="summary">On item add callback(self, node, index)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
<td class="name" nowrap><a href="#on_remove_item">on_remove_item</a></td>
<td class="summary">On item remove callback(self, index)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_change_items">on_change_items</a></td>
<td class="summary">On item add or remove callback(self, index)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_clear">on_clear</a></td>
<td class="summary">On grid clear callback(self)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_update_positions">on_update_positions</a></td>
<td class="summary">On update item positions callback(self)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#parent">parent</a></td>
<td class="summary">Parent gui node</td>
</tr>
<tr>
<td class="name" nowrap><a href="#nodes">nodes</a></td>
<td class="summary">List of all grid nodes</td>
</tr>
<tr>
<td class="name" nowrap><a href="#first_index">first_index</a></td>
<td class="summary">The first index of node in grid</td>
</tr>
<tr>
<td class="name" nowrap><a href="#last_index">last_index</a></td>
<td class="summary">The last index of node in grid</td>
</tr>
<tr>
<td class="name" nowrap><a href="#node_size">node_size</a></td>
<td class="summary">Item size</td>
</tr>
</table>
@ -150,7 +169,7 @@
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(parent)</strong>
<strong>init(self, parent)</strong>
</dt>
<dd>
Component init function
@ -158,6 +177,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DynamicGrid</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
@ -171,7 +194,7 @@
</dd>
<dt>
<a name = "get_pos"></a>
<strong>get_pos(index, node)</strong>
<strong>get_pos(self, index, node[, origin_index])</strong>
</dt>
<dd>
Return pos for grid node index
@ -179,6 +202,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DynamicGrid</span></span>
</li>
<li><span class="parameter">index</span>
<span class="types"><span class="type">number</span></span>
The grid element index
@ -187,6 +214,11 @@
<span class="types"><span class="type">node</span></span>
The node to be placed
</li>
<li><span class="parameter">origin_index</span>
<span class="types"><span class="type">number</span></span>
Index of nearby node
(<em>optional</em>)
</li>
</ul>
<h3>Returns:</h3>
@ -202,7 +234,7 @@
</dd>
<dt>
<a name = "add"></a>
<strong>add(node[, index[, is_shift_left=false]])</strong>
<strong>add(self, node[, index[, is_shift_left=false]])</strong>
</dt>
<dd>
Add new node to the grid
@ -210,6 +242,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DynamicGrid</span></span>
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui node
@ -233,7 +269,7 @@
</dd>
<dt>
<a name = "remove"></a>
<strong>remove(index[, is_shift_left=false])</strong>
<strong>remove(self, index[, is_shift_left=false])</strong>
</dt>
<dd>
Remove the item from the grid. Note that gui node will be not deleted
@ -241,6 +277,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DynamicGrid</span></span>
</li>
<li><span class="parameter">index</span>
<span class="types"><span class="type">number</span></span>
The grid node index to remove
@ -259,12 +299,23 @@
</dd>
<dt>
<a name = "get_size"></a>
<strong>get_size()</strong>
<strong>get_size(self, border)</strong>
</dt>
<dd>
Return grid content size
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DynamicGrid</span></span>
</li>
<li><span class="parameter">border</span>
<span class="types"><span class="type">vector3</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
@ -279,7 +330,7 @@
</dd>
<dt>
<a name = "get_index_by_node"></a>
<strong>get_index_by_node(node)</strong>
<strong>get_index_by_node(self, node)</strong>
</dt>
<dd>
Return grid index by node
@ -287,6 +338,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DynamicGrid</span></span>
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
The gui node in the grid
@ -306,12 +361,19 @@
</dd>
<dt>
<a name = "get_all_pos"></a>
<strong>get_all_pos()</strong>
<strong>get_all_pos(self)</strong>
</dt>
<dd>
Return array of all node positions
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DynamicGrid</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
@ -326,7 +388,7 @@
</dd>
<dt>
<a name = "set_position_function"></a>
<strong>set_position_function(callback)</strong>
<strong>set_position_function(self, callback)</strong>
</dt>
<dd>
Change set position function for grid nodes. It will call on
@ -335,6 +397,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DynamicGrid</span></span>
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Function on node set position
@ -354,13 +420,20 @@
</dd>
<dt>
<a name = "clear"></a>
<strong>clear()</strong>
<strong>clear(self)</strong>
</dt>
<dd>
Clear grid nodes array. GUI nodes will be not deleted!
If you want to delete GUI nodes, use dynamic_grid.nodes array before grid:clear
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">DynamicGrid</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
@ -374,8 +447,8 @@
</dd>
<dt>
<a name = "DynamicGrid:_get_side_vector"></a>
<strong>DynamicGrid:_get_side_vector(side, is_forward)</strong>
<a name = "_get_side_vector"></a>
<strong>_get_side_vector(self, side, is_forward)</strong>
</dt>
<dd>
Return side vector to correct node shifting
@ -383,15 +456,14 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
</li>
<li><span class="parameter">side</span>
</li>
<li><span class="parameter">is_forward</span>
</li>
</ul>
@ -401,38 +473,21 @@
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
<a name = "on_add_item"></a>
<strong>on_add_item</strong>
</dt>
<dd>
Component events
On item add callback(self, node, index)
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_add_item</span>
<span class="types"><span class="type">druid_event</span></span>
On item add callback
</li>
<li><span class="parameter">on_remove_item</span>
<span class="types"><span class="type">druid_event</span></span>
On item remove callback
</li>
<li><span class="parameter">on_change_items</span>
<span class="types"><span class="type">druid_event</span></span>
On item add or remove callback
</li>
<li><span class="parameter">on_clear</span>
<span class="types"><span class="type">druid_event</span></span>
On grid clear callback
</li>
<li><span class="parameter">on_update_positions</span>
<span class="types"><span class="type">druid_event</span></span>
On update item positions callback
</li>
</ul>
@ -442,38 +497,177 @@
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
<a name = "on_remove_item"></a>
<strong>on_remove_item</strong>
</dt>
<dd>
Component fields
On item remove callback(self, index)
<ul>
<li><span class="parameter">on_remove_item</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_change_items"></a>
<strong>on_change_items</strong>
</dt>
<dd>
On item add or remove callback(self, index)
<ul>
<li><span class="parameter">on_change_items</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_clear"></a>
<strong>on_clear</strong>
</dt>
<dd>
On grid clear callback(self)
<ul>
<li><span class="parameter">on_clear</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_update_positions"></a>
<strong>on_update_positions</strong>
</dt>
<dd>
On update item positions callback(self)
<ul>
<li><span class="parameter">on_update_positions</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "parent"></a>
<strong>parent</strong>
</dt>
<dd>
Parent gui node
<h3>Fields:</h3>
<ul>
<li><span class="parameter">parent</span>
<span class="types"><span class="type">node</span></span>
Parent gui node
</li>
</ul>
</dd>
<dt>
<a name = "nodes"></a>
<strong>nodes</strong>
</dt>
<dd>
List of all grid nodes
<ul>
<li><span class="parameter">nodes</span>
<span class="types"><span class="type">node[]</span></span>
List of all grid nodes
</li>
</ul>
</dd>
<dt>
<a name = "first_index"></a>
<strong>first_index</strong>
</dt>
<dd>
The first index of node in grid
<ul>
<li><span class="parameter">first_index</span>
<span class="types"><span class="type">number</span></span>
The first index of node in grid
</li>
</ul>
</dd>
<dt>
<a name = "last_index"></a>
<strong>last_index</strong>
</dt>
<dd>
The last index of node in grid
<ul>
<li><span class="parameter">last_index</span>
<span class="types"><span class="type">number</span></span>
The last index of node in grid
</li>
</ul>
</dd>
<dt>
<a name = "node_size"></a>
<strong>node_size</strong>
</dt>
<dd>
Item size
<ul>
<li><span class="parameter">node_size</span>
<span class="types"><span class="type">vector3</span></span>
Item size
</li>
<li><span class="parameter">border</span>
<span class="types"><span class="type">vector4</span></span>
The size of item content
</li>
</ul>
@ -489,7 +683,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -33,91 +33,78 @@
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><strong>druid.hover</strong></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><strong>Hover</strong></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.hover</code></h1>
<h1>Module <code>Hover</code></h1>
<p>Component to handle hover node interaction</p>
<p>
</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, on_hover_callback)</a></td>
<td class="name" nowrap><a href="#init">init(self, node, on_hover_callback)</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_hover">set_hover(state)</a></td>
<td class="name" nowrap><a href="#set_hover">set_hover(self, state)</a></td>
<td class="summary">Set hover state</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_mouse_hover">set_mouse_hover(state)</a></td>
<td class="name" nowrap><a href="#set_mouse_hover">set_mouse_hover(self, state)</a></td>
<td class="summary">Set mouse hover state</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_click_zone">set_click_zone(zone)</a></td>
<td class="name" nowrap><a href="#set_click_zone">set_click_zone(self, zone)</a></td>
<td class="summary">Strict hover click area.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_enabled">set_enabled(state)</a></td>
<td class="name" nowrap><a href="#set_enabled">set_enabled(self, state)</a></td>
<td class="summary">Set enable state of hover component.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_enabled">is_enabled()</a></td>
<td class="name" nowrap><a href="#is_enabled">is_enabled(self)</a></td>
<td class="summary">Return current hover enabled state</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
<td class="name" nowrap><a href="#on_hover">on_hover</a></td>
<td class="summary">On hover callback(self, state)</td>
</tr>
</table>
@ -130,7 +117,7 @@
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, on_hover_callback)</strong>
<strong>init(self, node, on_hover_callback)</strong>
</dt>
<dd>
Component init function
@ -138,6 +125,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Hover</span></span>
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui node
@ -155,7 +146,7 @@
</dd>
<dt>
<a name = "set_hover"></a>
<strong>set_hover(state)</strong>
<strong>set_hover(self, state)</strong>
</dt>
<dd>
Set hover state
@ -163,6 +154,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Hover</span></span>
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
The hover state
@ -176,7 +171,7 @@
</dd>
<dt>
<a name = "set_mouse_hover"></a>
<strong>set_mouse_hover(state)</strong>
<strong>set_mouse_hover(self, state)</strong>
</dt>
<dd>
Set mouse hover state
@ -184,6 +179,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Hover</span></span>
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
The mouse hover state
@ -197,7 +196,7 @@
</dd>
<dt>
<a name = "set_click_zone"></a>
<strong>set_click_zone(zone)</strong>
<strong>set_click_zone(self, zone)</strong>
</dt>
<dd>
Strict hover click area. Useful for
@ -206,6 +205,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Hover</span></span>
</li>
<li><span class="parameter">zone</span>
<span class="types"><span class="type">node</span></span>
Gui node
@ -219,7 +222,7 @@
</dd>
<dt>
<a name = "set_enabled"></a>
<strong>set_enabled(state)</strong>
<strong>set_enabled(self, state)</strong>
</dt>
<dd>
Set enable state of hover component.
@ -229,6 +232,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Hover</span></span>
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
The hover enabled state
@ -242,12 +249,19 @@
</dd>
<dt>
<a name = "is_enabled"></a>
<strong>is_enabled()</strong>
<strong>is_enabled(self)</strong>
</dt>
<dd>
Return current hover enabled state
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Hover</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
@ -261,26 +275,21 @@
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
<a name = "on_hover"></a>
<strong>on_hover</strong>
</dt>
<dd>
Component events
On hover callback(self, state)
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_hover</span>
<span class="types"><span class="type">druid_event</span></span>
On hover callback (Touch pressed)
</li>
<li><span class="parameter">on_mouse_hover</span>
<span class="types"><span class="type">druid_event</span></span>
On mouse hover callback (Touch over without action_id)
</li>
</ul>
@ -296,7 +305,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -34,54 +34,45 @@
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><strong>druid.input</strong></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><strong>Input</strong></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.input</code></h1>
<h1>Module <code>Input</code></h1>
<p>Druid input text component.</p>
<p> Carry on user text input</p>
<p>
Carry on user text input</p>
<h3>Info:</h3>
<ul>
<li><strong>Author</strong>: Part of code from Britzl gooey input component</li>
@ -91,41 +82,84 @@
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#set_text">set_text(input_text)</a></td>
<td class="name" nowrap><a href="#set_text">set_text(self, input_text)</a></td>
<td class="summary">Set text for input field</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_text">get_text()</a></td>
<td class="name" nowrap><a href="#get_text">get_text(self)</a></td>
<td class="summary">Return current input field text</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_max_length">set_max_length(max_length)</a></td>
<td class="name" nowrap><a href="#set_max_length">set_max_length(self, max_length)</a></td>
<td class="summary">Set maximum length for input field.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_allowerd_characters">set_allowerd_characters(characters)</a></td>
<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="#reset_changes">reset_changes()</a></td>
<td class="name" nowrap><a href="#reset_changes">reset_changes(self)</a></td>
<td class="summary">Reset current input selection and return previous value</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Style">Style</a></td>
<td class="name" nowrap><a href="#style">style</a></td>
<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="#on_input_select">on_input_select</a></td>
<td class="summary">On input field select callback(self, button_node)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_input_unselect">on_input_unselect</a></td>
<td class="summary">On input field unselect callback(self, button_node)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_input_text">on_input_text</a></td>
<td class="summary">On input field text change callback(self, input_text)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_input_empty">on_input_empty</a></td>
<td class="summary">On input field text change to empty string callback(self, input_text)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_input_full">on_input_full</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="#on_input_wrong">on_input_wrong</a></td>
<td class="summary">On trying user input with not allowed character callback(self, params, button_instance)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#text">text</a></td>
<td class="summary">Text component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#button">button</a></td>
<td class="summary">Button component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_selected">is_selected</a></td>
<td class="summary">Is current input selected now</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_empty">is_empty</a></td>
<td class="summary">Is current input is empty now</td>
</tr>
<tr>
<td class="name" nowrap><a href="#max_length">max_length</a></td>
<td class="summary">Max length for input text</td>
</tr>
<tr>
<td class="name" nowrap><a href="#allowerd_characters">allowerd_characters</a></td>
<td class="summary">Pattern matching for user input</td>
</tr>
</table>
<br/>
<br/>
@ -136,7 +170,7 @@
<dl class="function">
<dt>
<a name = "set_text"></a>
<strong>set_text(input_text)</strong>
<strong>set_text(self, input_text)</strong>
</dt>
<dd>
Set text for input field
@ -144,6 +178,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Input</span></span>
</li>
<li><span class="parameter">input_text</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
The string to apply for input field
@ -157,12 +195,19 @@
</dd>
<dt>
<a name = "get_text"></a>
<strong>get_text()</strong>
<strong>get_text(self)</strong>
</dt>
<dd>
Return current input field text
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Input</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
@ -177,7 +222,7 @@
</dd>
<dt>
<a name = "set_max_length"></a>
<strong>set_max_length(max_length)</strong>
<strong>set_max_length(self, max_length)</strong>
</dt>
<dd>
Set maximum length for input field.
@ -186,6 +231,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Input</span></span>
</li>
<li><span class="parameter">max_length</span>
<span class="types"><span class="type">number</span></span>
Maximum length for input text field
@ -204,8 +253,8 @@
</dd>
<dt>
<a name = "set_allowerd_characters"></a>
<strong>set_allowerd_characters(characters)</strong>
<a name = "set_allowed_characters"></a>
<strong>set_allowed_characters(self, characters)</strong>
</dt>
<dd>
Set allowed charaters for input field.
@ -215,6 +264,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Input</span></span>
</li>
<li><span class="parameter">characters</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Regulax exp. for validate user input
@ -234,12 +287,19 @@
</dd>
<dt>
<a name = "reset_changes"></a>
<strong>reset_changes()</strong>
<strong>reset_changes(self)</strong>
</dt>
<dd>
Reset current input selection and return previous value
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Input</span></span>
</li>
</ul>
@ -251,96 +311,8 @@
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_input_select</span>
<span class="types"><span class="type">druid_event</span></span>
(self, button_node) On input field select callback
</li>
<li><span class="parameter">on_input_unselect</span>
<span class="types"><span class="type">druid_event</span></span>
(self, button_node) On input field unselect callback
</li>
<li><span class="parameter">on_input_text</span>
<span class="types"><span class="type">druid_event</span></span>
(self, input_text) On input field text change callback
</li>
<li><span class="parameter">on_input_empty</span>
<span class="types"><span class="type">druid_event</span></span>
(self, input_text) On input field text change to empty string callback
</li>
<li><span class="parameter">on_input_full</span>
<span class="types"><span class="type">druid_event</span></span>
(self, input_text) On input field text change to max length string callback
</li>
<li><span class="parameter">on_input_wrong</span>
<span class="types"><span class="type">druid_event</span></span>
(self, params, button_instance) On trying user input with not allowed character callback
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">text</span>
<span class="types"><span class="type">druid.text</span></span>
Text component
</li>
<li><span class="parameter">button</span>
<span class="types"><span class="type">druid.button</span></span>
Button component
</li>
<li><span class="parameter">is_selected</span>
<span class="types"><span class="type">bool</span></span>
Is current input selected now
</li>
<li><span class="parameter">is_empty</span>
<span class="types"><span class="type">bool</span></span>
Is current input is empty now
</li>
<li><span class="parameter">max_length</span>
<span class="types"><span class="type">number</span></span>
Max length for input text
(<em>optional</em>)
</li>
<li><span class="parameter">allowerd_characters</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Pattern matching for user input
(<em>optional</em>)
</li>
<li><span class="parameter">keyboard_type</span>
<span class="types"><span class="type">number</span></span>
Gui keyboard type for input field
</li>
</ul>
</dd>
<dt>
<a name = "Style"></a>
<strong>Style</strong>
<a name = "style"></a>
<strong>style</strong>
</dt>
<dd>
Component style params.
@ -382,6 +354,252 @@
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "on_input_select"></a>
<strong>on_input_select</strong>
</dt>
<dd>
On input field select callback(self, button_node)
<ul>
<li><span class="parameter">on_input_select</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_input_unselect"></a>
<strong>on_input_unselect</strong>
</dt>
<dd>
On input field unselect callback(self, button_node)
<ul>
<li><span class="parameter">on_input_unselect</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_input_text"></a>
<strong>on_input_text</strong>
</dt>
<dd>
On input field text change callback(self, input_text)
<ul>
<li><span class="parameter">on_input_text</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_input_empty"></a>
<strong>on_input_empty</strong>
</dt>
<dd>
On input field text change to empty string callback(self, input_text)
<ul>
<li><span class="parameter">on_input_empty</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_input_full"></a>
<strong>on_input_full</strong>
</dt>
<dd>
On input field text change to max length string callback(self, input_text)
<ul>
<li><span class="parameter">on_input_full</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_input_wrong"></a>
<strong>on_input_wrong</strong>
</dt>
<dd>
On trying user input with not allowed character callback(self, params, button_instance)
<ul>
<li><span class="parameter">on_input_wrong</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "text"></a>
<strong>text</strong>
</dt>
<dd>
Text component
<ul>
<li><span class="parameter">text</span>
<span class="types"><span class="type">druid.text</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "button"></a>
<strong>button</strong>
</dt>
<dd>
Button component
<ul>
<li><span class="parameter">button</span>
<span class="types"><span class="type">druid.button</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "is_selected"></a>
<strong>is_selected</strong>
</dt>
<dd>
Is current input selected now
<ul>
<li><span class="parameter">is_selected</span>
<span class="types"><span class="type">bool</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "is_empty"></a>
<strong>is_empty</strong>
</dt>
<dd>
Is current input is empty now
<ul>
<li><span class="parameter">is_empty</span>
<span class="types"><span class="type">bool</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "max_length"></a>
<strong>max_length</strong>
</dt>
<dd>
Max length for input text
<ul>
<li><span class="parameter">max_length</span>
<span class="types"><span class="type">number</span></span>
(<em>optional</em>)
</li>
</ul>
</dd>
<dt>
<a name = "allowerd_characters"></a>
<strong>allowerd_characters</strong>
</dt>
<dd>
Pattern matching for user input
<ul>
<li><span class="parameter">allowerd_characters</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
(<em>optional</em>)
</li>
</ul>
</dd>
</dl>
@ -390,7 +608,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -33,84 +33,67 @@
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><strong>druid.lang_text</strong></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><strong>LangText</strong></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.lang_text</code></h1>
<h1>Module <code>LangText</code></h1>
<p>Component to handle all GUI texts
Good working with localization system</p>
<p>
</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, locale_id, no_adjust)</a></td>
<td class="name" nowrap><a href="#init">init(self, node, locale_id, no_adjust)</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_to">set_to(text)</a></td>
<td class="name" nowrap><a href="#set_to">set_to(self, text)</a></td>
<td class="summary">Setup raw text to lang_text component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#translate">translate(locale_id)</a></td>
<td class="name" nowrap><a href="#translate">translate(self, locale_id)</a></td>
<td class="summary">Translate the text by locale_id</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
<td class="name" nowrap><a href="#on_change">on_change</a></td>
<td class="summary">On change text callback</td>
</tr>
</table>
@ -123,7 +106,7 @@
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, locale_id, no_adjust)</strong>
<strong>init(self, node, locale_id, no_adjust)</strong>
</dt>
<dd>
Component init function
@ -131,6 +114,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">LangText</span></span>
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
The text node
@ -152,7 +139,7 @@
</dd>
<dt>
<a name = "set_to"></a>
<strong>set_to(text)</strong>
<strong>set_to(self, text)</strong>
</dt>
<dd>
Setup raw text to lang_text component
@ -160,6 +147,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">LangText</span></span>
</li>
<li><span class="parameter">text</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Text for text node
@ -173,7 +164,7 @@
</dd>
<dt>
<a name = "translate"></a>
<strong>translate(locale_id)</strong>
<strong>translate(self, locale_id)</strong>
</dt>
<dd>
Translate the text by locale_id
@ -181,6 +172,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">LangText</span></span>
</li>
<li><span class="parameter">locale_id</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Locale id
@ -193,43 +188,21 @@
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
<a name = "on_change"></a>
<strong>on_change</strong>
</dt>
<dd>
Component events
On change text callback
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_change</span>
<span class="types"><span class="type">druid_event</span></span>
On change text callback
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">text</span>
<span class="types"><span class="type">druid.text</span></span>
The text component
</li>
</ul>
@ -245,7 +218,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -34,102 +34,112 @@
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><strong>druid.progress</strong></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><strong>Progress</strong></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.progress</code></h1>
<h1>Module <code>Progress</code></h1>
<p>Basic progress bar component.</p>
<p> For correct progress bar init it should be in max size from gui</p>
<p>
For correct progress bar init it should be in max size from gui</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, key[, init_value=1])</a></td>
<td class="name" nowrap><a href="#init">init(self, node, key[, init_value=1])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#fill">fill()</a></td>
<td class="name" nowrap><a href="#fill">fill(self)</a></td>
<td class="summary">Fill a progress bar and stop progress animation</td>
</tr>
<tr>
<td class="name" nowrap><a href="#empty">empty()</a></td>
<td class="name" nowrap><a href="#empty">empty(self)</a></td>
<td class="summary">Empty a progress bar</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_to">set_to(to)</a></td>
<td class="name" nowrap><a href="#set_to">set_to(self, to)</a></td>
<td class="summary">Instant fill progress bar to value</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get">get()</a></td>
<td class="name" nowrap><a href="#get">get(self)</a></td>
<td class="summary">Return current progress bar value</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_steps">set_steps(steps, callback)</a></td>
<td class="name" nowrap><a href="#set_steps">set_steps(self, steps, callback)</a></td>
<td class="summary">Set points on progress bar to fire the callback</td>
</tr>
<tr>
<td class="name" nowrap><a href="#to">to(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>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Style">Style</a></td>
<td class="name" nowrap><a href="#style">style</a></td>
<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="#on_change">on_change</a></td>
<td class="summary">On progress bar change callback(self, new_value)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#node">node</a></td>
<td class="summary">Progress bar fill node</td>
</tr>
<tr>
<td class="name" nowrap><a href="#key">key</a></td>
<td class="summary">The progress bar direction</td>
</tr>
<tr>
<td class="name" nowrap><a href="#scale">scale</a></td>
<td class="summary">Current progress bar scale</td>
</tr>
<tr>
<td class="name" nowrap><a href="#size">size</a></td>
<td class="summary">Current progress bar size</td>
</tr>
<tr>
<td class="name" nowrap><a href="#max_size">max_size</a></td>
<td class="summary">Maximum size of progress bar</td>
</tr>
</table>
<br/>
<br/>
@ -140,7 +150,7 @@
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, key[, init_value=1])</strong>
<strong>init(self, node, key[, init_value=1])</strong>
</dt>
<dd>
Component init function
@ -148,8 +158,12 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Progress</span></span>
</li>
<li><span class="parameter">node</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a> or <span class="type">node</span></span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a> or <a class="type" href="../modules/Progress.html#node">node</a></span>
Progress bar fill node or node name
</li>
<li><span class="parameter">key</span>
@ -170,12 +184,19 @@
</dd>
<dt>
<a name = "fill"></a>
<strong>fill()</strong>
<strong>fill(self)</strong>
</dt>
<dd>
Fill a progress bar and stop progress animation
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Progress</span></span>
</li>
</ul>
@ -184,12 +205,19 @@
</dd>
<dt>
<a name = "empty"></a>
<strong>empty()</strong>
<strong>empty(self)</strong>
</dt>
<dd>
Empty a progress bar
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Progress</span></span>
</li>
</ul>
@ -198,7 +226,7 @@
</dd>
<dt>
<a name = "set_to"></a>
<strong>set_to(to)</strong>
<strong>set_to(self, to)</strong>
</dt>
<dd>
Instant fill progress bar to value
@ -206,6 +234,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Progress</span></span>
</li>
<li><span class="parameter">to</span>
<span class="types"><span class="type">number</span></span>
Progress bar value, from 0 to 1
@ -219,12 +251,19 @@
</dd>
<dt>
<a name = "get"></a>
<strong>get()</strong>
<strong>get(self)</strong>
</dt>
<dd>
Return current progress bar value
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Progress</span></span>
</li>
</ul>
@ -233,7 +272,7 @@
</dd>
<dt>
<a name = "set_steps"></a>
<strong>set_steps(steps, callback)</strong>
<strong>set_steps(self, steps, callback)</strong>
</dt>
<dd>
Set points on progress bar to fire the callback
@ -241,6 +280,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Progress</span></span>
</li>
<li><span class="parameter">steps</span>
<span class="types"><span class="type">number[]</span></span>
Array of progress bar values
@ -262,7 +305,7 @@
</dd>
<dt>
<a name = "to"></a>
<strong>to(to[, callback])</strong>
<strong>to(self, to[, callback])</strong>
</dt>
<dd>
Start animation of a progress bar
@ -270,6 +313,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Progress</span></span>
</li>
<li><span class="parameter">to</span>
<span class="types"><span class="type">number</span></span>
value between 0..1
@ -291,70 +338,8 @@
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_change</span>
<span class="types"><span class="type">druid_event</span></span>
On progress bar change callback
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Progress bar fill node
</li>
<li><span class="parameter">key</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
The progress bar direction
</li>
<li><span class="parameter">scale</span>
<span class="types"><span class="type">vector3</span></span>
Current progress bar scale
</li>
<li><span class="parameter">size</span>
<span class="types"><span class="type">vector3</span></span>
Current progress bar size
</li>
<li><span class="parameter">max_size</span>
<span class="types"><span class="type">number</span></span>
Maximum size of progress bar
</li>
<li><span class="parameter">slice</span>
<span class="types"><span class="type">vector4</span></span>
Progress bar slice9 settings
</li>
</ul>
</dd>
<dt>
<a name = "Style"></a>
<strong>Style</strong>
<a name = "style"></a>
<strong>style</strong>
</dt>
<dd>
Component style params.
@ -380,6 +365,130 @@
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "on_change"></a>
<strong>on_change</strong>
</dt>
<dd>
On progress bar change callback(self, new_value)
<ul>
<li><span class="parameter">on_change</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "node"></a>
<strong>node</strong>
</dt>
<dd>
Progress bar fill node
<ul>
<li><span class="parameter">node</span>
<span class="types"><a class="type" href="../modules/Progress.html#node">node</a></span>
</li>
</ul>
</dd>
<dt>
<a name = "key"></a>
<strong>key</strong>
</dt>
<dd>
The progress bar direction
<ul>
<li><span class="parameter">key</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
</li>
</ul>
</dd>
<dt>
<a name = "scale"></a>
<strong>scale</strong>
</dt>
<dd>
Current progress bar scale
<ul>
<li><span class="parameter">scale</span>
<span class="types"><span class="type">vector3</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "size"></a>
<strong>size</strong>
</dt>
<dd>
Current progress bar size
<ul>
<li><span class="parameter">size</span>
<span class="types"><span class="type">vector3</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "max_size"></a>
<strong>max_size</strong>
</dt>
<dd>
Maximum size of progress bar
<ul>
<li><span class="parameter">max_size</span>
<span class="types"><span class="type">number</span></span>
</li>
</ul>
</dd>
</dl>
@ -388,7 +497,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -0,0 +1,227 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><strong>RadioGroup</strong></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>RadioGroup</code></h1>
<p>Radio group module</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(self, nodes, callback[, click_nodes=node])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_state">set_state(self, index)</a></td>
<td class="summary">Set radio group state</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_state">get_state(self)</a></td>
<td class="summary">Return radio group state</td>
</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#on_radio_click">on_radio_click</a></td>
<td class="summary">On any checkbox click</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(self, nodes, callback[, click_nodes=node])</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">RadioGroup</span></span>
</li>
<li><span class="parameter">nodes</span>
<span class="types"><span class="type">node[]</span></span>
Array of gui node
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Radio callback
</li>
<li><span class="parameter">click_nodes</span>
<span class="types"><span class="type">node[]</span></span>
Array of trigger nodes, by default equals to nodes
(<em>default</em> node)
</li>
</ul>
</dd>
<dt>
<a name = "set_state"></a>
<strong>set_state(self, index)</strong>
</dt>
<dd>
Set radio group state
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">RadioGroup</span></span>
</li>
<li><span class="parameter">index</span>
<span class="types"><span class="type">number</span></span>
Index in radio group
</li>
</ul>
</dd>
<dt>
<a name = "get_state"></a>
<strong>get_state(self)</strong>
</dt>
<dd>
Return radio group state
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">RadioGroup</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">number</span></span>
Index in radio group
</ol>
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "on_radio_click"></a>
<strong>on_radio_click</strong>
</dt>
<dd>
On any checkbox click
<ul>
<li><span class="parameter">on_radio_click</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -34,54 +34,45 @@
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><strong>druid.scroll</strong></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><strong>Scroll</strong></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.scroll</code></h1>
<h1>Module <code>Scroll</code></h1>
<p>Component to handle scroll content.</p>
<p> Scroll consist from two nodes: scroll parent and scroll input
<p>
Scroll consist from two nodes: scroll parent and scroll input
Scroll input the user input zone, it's static
Scroll parent the scroll moving part, it will change position.
Setup initial scroll size by changing scroll parent size. If scroll parent
@ -92,82 +83,129 @@
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(view_node, content_node)</a></td>
<td class="summary">Scroll constructor.</td>
<td class="name" nowrap><a href="#init">init(self, view_node, content_node)</a></td>
<td class="summary">Scroll constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#scroll_to">scroll_to(vector3[, 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(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(vector3[, 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>
<td class="name" nowrap><a href="#get_percent">get_percent()</a></td>
<td class="name" nowrap><a href="#get_percent">get_percent(self)</a></td>
<td class="summary">Return current scroll progress status.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_size">set_size(size)</a></td>
<td class="name" nowrap><a href="#set_size">set_size(self, size)</a></td>
<td class="summary">Set scroll content size.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_inert">set_inert(state)</a></td>
<td class="name" nowrap><a href="#set_inert">set_inert(self, state)</a></td>
<td class="summary">Enable or disable scroll inert.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_inert">is_inert()</a></td>
<td class="name" nowrap><a href="#is_inert">is_inert(self)</a></td>
<td class="summary">Return if scroll have inertion.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_extra_stretch_size">set_extra_stretch_size([stretch_size=0])</a></td>
<td class="name" nowrap><a href="#set_extra_stretch_size">set_extra_stretch_size(self[, stretch_size=0])</a></td>
<td class="summary">Set extra size for scroll stretching.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_scroll_size">get_scroll_size()</a></td>
<td class="name" nowrap><a href="#get_scroll_size">get_scroll_size(self)</a></td>
<td class="summary">Return vector of scroll size with width and height.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_points">set_points(points)</a></td>
<td class="name" nowrap><a href="#set_points">set_points(self, points)</a></td>
<td class="summary">Set points of interest.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_horizontal_scroll">set_horizontal_scroll(state)</a></td>
<td class="name" nowrap><a href="#set_horizontal_scroll">set_horizontal_scroll(self, state)</a></td>
<td class="summary">Lock or unlock horizontal scroll</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_vertical_scroll">set_vertical_scroll(state)</a></td>
<td class="name" nowrap><a href="#set_vertical_scroll">set_vertical_scroll(self, state)</a></td>
<td class="summary">Lock or unlock vertical scroll</td>
</tr>
<tr>
<td class="name" nowrap><a href="#bind_grid">bind_grid(Druid)</a></td>
<td class="name" nowrap><a href="#bind_grid">bind_grid(self, grid)</a></td>
<td class="summary">Bind the grid component (Static or Dynamic) to recalculate
scroll size on grid changes</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Scroll:_cancel_animate">Scroll:_cancel_animate()</a></td>
<td class="name" nowrap><a href="#_cancel_animate">_cancel_animate(self)</a></td>
<td class="summary">Cancel animation on other animation or input touch</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Style">Style</a></td>
<td class="name" nowrap><a href="#style">style</a></td>
<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="#on_scroll">on_scroll</a></td>
<td class="summary">On scroll move callback(self, position)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_scroll_to">on_scroll_to</a></td>
<td class="summary">On scroll_to function callback(self, target, is_instant)</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>
<tr>
<td class="name" nowrap><a href="#view_node">view_node</a></td>
<td class="summary">Scroll view node</td>
</tr>
<tr>
<td class="name" nowrap><a href="#content_node">content_node</a></td>
<td class="summary">Scroll content node</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="#inertion">inertion</a></td>
<td class="summary">Current inert speed</td>
</tr>
<tr>
<td class="name" nowrap><a href="#position">position</a></td>
<td class="summary">Current scroll posisition</td>
</tr>
<tr>
<td class="name" nowrap><a href="#target_position">target_position</a></td>
<td class="summary">Current scroll target position</td>
</tr>
<tr>
<td class="name" nowrap><a href="#available_pos">available_pos</a></td>
<td class="summary">Available position for content node: (min_x, max_y, max_x, min_y)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#available_size">available_size</a></td>
<td class="summary">Size of available positions: (width, height, 0)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#drag">drag</a></td>
<td class="summary">Drag Druid component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#selected">selected</a></td>
<td class="summary">Current index of points of interests</td>
</tr>
</table>
<br/>
<br/>
@ -178,14 +216,18 @@
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(view_node, content_node)</strong>
<strong>init(self, view_node, content_node)</strong>
</dt>
<dd>
Scroll constructor.
Scroll constructor
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Scroll</span></span>
</li>
<li><span class="parameter">view_node</span>
<span class="types"><span class="type">node</span></span>
GUI view scroll node
@ -203,7 +245,7 @@
</dd>
<dt>
<a name = "scroll_to"></a>
<strong>scroll_to(vector3[, is_instant])</strong>
<strong>scroll_to(self, point[, is_instant])</strong>
</dt>
<dd>
Start scroll to target point.
@ -211,8 +253,12 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">vector3</span>
<span class="types"><span class="type">point</span></span>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Scroll</span></span>
</li>
<li><span class="parameter">point</span>
<span class="types"><span class="type">vector3</span></span>
Target point
</li>
<li><span class="parameter">is_instant</span>
@ -234,7 +280,7 @@
</dd>
<dt>
<a name = "scroll_to_index"></a>
<strong>scroll_to_index(index[, skip_cb])</strong>
<strong>scroll_to_index(self, index[, skip_cb])</strong>
</dt>
<dd>
Scroll to item in scroll by point index.
@ -242,6 +288,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Scroll</span></span>
</li>
<li><span class="parameter">index</span>
<span class="types"><span class="type">number</span></span>
Point index
@ -260,7 +310,7 @@
</dd>
<dt>
<a name = "scroll_to_percent"></a>
<strong>scroll_to_percent(vector3[, is_instant])</strong>
<strong>scroll_to_percent(self, percent[, is_instant])</strong>
</dt>
<dd>
Start scroll to target scroll percent
@ -268,8 +318,12 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">vector3</span>
<span class="types"><span class="type">point</span></span>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Scroll</span></span>
</li>
<li><span class="parameter">percent</span>
<span class="types"><span class="type">vector3</span></span>
target percent
</li>
<li><span class="parameter">is_instant</span>
@ -290,13 +344,20 @@
</dd>
<dt>
<a name = "get_percent"></a>
<strong>get_percent()</strong>
<strong>get_percent(self)</strong>
</dt>
<dd>
Return current scroll progress status.
Values will be in [0..1] interval
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Scroll</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
@ -311,7 +372,7 @@
</dd>
<dt>
<a name = "set_size"></a>
<strong>set_size(size)</strong>
<strong>set_size(self, size)</strong>
</dt>
<dd>
Set scroll content size.
@ -320,6 +381,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Scroll</span></span>
</li>
<li><span class="parameter">size</span>
<span class="types"><span class="type">vector3</span></span>
The new size for content node
@ -339,7 +404,7 @@
</dd>
<dt>
<a name = "set_inert"></a>
<strong>set_inert(state)</strong>
<strong>set_inert(self, state)</strong>
</dt>
<dd>
Enable or disable scroll inert.
@ -349,6 +414,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Scroll</span></span>
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
Inert scroll state
@ -368,12 +437,19 @@
</dd>
<dt>
<a name = "is_inert"></a>
<strong>is_inert()</strong>
<strong>is_inert(self)</strong>
</dt>
<dd>
Return if scroll have inertion.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Scroll</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
@ -388,7 +464,7 @@
</dd>
<dt>
<a name = "set_extra_stretch_size"></a>
<strong>set_extra_stretch_size([stretch_size=0])</strong>
<strong>set_extra_stretch_size(self[, stretch_size=0])</strong>
</dt>
<dd>
Set extra size for scroll stretching.
@ -397,6 +473,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Scroll</span></span>
</li>
<li><span class="parameter">stretch_size</span>
<span class="types"><span class="type">number</span></span>
Size in pixels of additional scroll area
@ -417,12 +497,19 @@
</dd>
<dt>
<a name = "get_scroll_size"></a>
<strong>get_scroll_size()</strong>
<strong>get_scroll_size(self)</strong>
</dt>
<dd>
Return vector of scroll size with width and height.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Scroll</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
@ -437,7 +524,7 @@
</dd>
<dt>
<a name = "set_points"></a>
<strong>set_points(points)</strong>
<strong>set_points(self, points)</strong>
</dt>
<dd>
Set points of interest.
@ -446,6 +533,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Scroll</span></span>
</li>
<li><span class="parameter">points</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Array of vector3 points
@ -465,7 +556,7 @@
</dd>
<dt>
<a name = "set_horizontal_scroll"></a>
<strong>set_horizontal_scroll(state)</strong>
<strong>set_horizontal_scroll(self, state)</strong>
</dt>
<dd>
Lock or unlock horizontal scroll
@ -473,6 +564,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Scroll</span></span>
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
True, if horizontal scroll is enabled
@ -492,7 +587,7 @@
</dd>
<dt>
<a name = "set_vertical_scroll"></a>
<strong>set_vertical_scroll(state)</strong>
<strong>set_vertical_scroll(self, state)</strong>
</dt>
<dd>
Lock or unlock vertical scroll
@ -500,6 +595,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Scroll</span></span>
</li>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
True, if vertical scroll is enabled
@ -519,7 +618,7 @@
</dd>
<dt>
<a name = "bind_grid"></a>
<strong>bind_grid(Druid)</strong>
<strong>bind_grid(self, grid)</strong>
</dt>
<dd>
Bind the grid component (Static or Dynamic) to recalculate
@ -528,9 +627,13 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">Druid</span>
<span class="types"><span class="type">druid.static_grid</span> or <span class="type">druid.dynamic_grid</span></span>
grid component
<li><span class="parameter">self</span>
<span class="types"><span class="type">Scroll</span></span>
</li>
<li><span class="parameter">grid</span>
<span class="types"><span class="type">StaticGrid</span> or <span class="type">DynamicGrid</span></span>
Druid grid component
</li>
</ul>
@ -546,13 +649,19 @@
</dd>
<dt>
<a name = "Scroll:_cancel_animate"></a>
<strong>Scroll:_cancel_animate()</strong>
<a name = "_cancel_animate"></a>
<strong>_cancel_animate(self)</strong>
</dt>
<dd>
Cancel animation on other animation or input touch
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
</li>
</ul>
@ -564,99 +673,8 @@
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_scroll</span>
<span class="types"><span class="type">druid_event</span></span>
On scroll move callback
</li>
<li><span class="parameter">on_scroll_to</span>
<span class="types"><span class="type">druid_event</span></span>
On scroll_to function callback
</li>
<li><span class="parameter">on_point_scroll</span>
<span class="types"><span class="type">druid_event</span></span>
On scroll<em>to</em>index function callback
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">view_node</span>
<span class="types"><span class="type">node</span></span>
Scroll view node
</li>
<li><span class="parameter">content_node</span>
<span class="types"><span class="type">node</span></span>
Scroll content node
</li>
<li><span class="parameter">is_inert</span>
<span class="types"><span class="type">bool</span></span>
Flag, if scroll now moving by inertion
</li>
<li><span class="parameter">inertion</span>
<span class="types"><span class="type">vector3</span></span>
Current inert speed
</li>
<li><span class="parameter">position</span>
<span class="types"><span class="type">vector3</span></span>
Current scroll posisition
</li>
<li><span class="parameter">target_position</span>
<span class="types"><span class="type">vector3</span></span>
Current scroll target position
</li>
<li><span class="parameter">available_pos</span>
<span class="types"><span class="type">vector4</span></span>
Available position for content node: (min<em>x, max</em>y, max<em>x, min</em>y)
</li>
<li><span class="parameter">available_size</span>
<span class="types"><span class="type">vector3</span></span>
Size of available positions: (width, height, 0)
</li>
<li><span class="parameter">drag</span>
<span class="types"><span class="type">druid.drag</span></span>
Drag component
</li>
<li><span class="parameter">Current</span>
<span class="types"><span class="type">selected</span></span>
index of points of interests
(<em>optional</em>)
</li>
<li><span class="parameter">is_animate</span>
<span class="types"><span class="type">bool</span></span>
Flag, if scroll now animating by gui.animate
</li>
</ul>
</dd>
<dt>
<a name = "Style"></a>
<strong>Style</strong>
<a name = "style"></a>
<strong>style</strong>
</dt>
<dd>
Component style params.
@ -717,6 +735,271 @@
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "on_scroll"></a>
<strong>on_scroll</strong>
</dt>
<dd>
On scroll move callback(self, position)
<ul>
<li><span class="parameter">on_scroll</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_scroll_to"></a>
<strong>on_scroll_to</strong>
</dt>
<dd>
On scroll_to function callback(self, target, is_instant)
<ul>
<li><span class="parameter">on_scroll_to</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_point_scroll"></a>
<strong>on_point_scroll</strong>
</dt>
<dd>
On scroll_to_index function callback(self, index, point)
<ul>
<li><span class="parameter">on_point_scroll</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "view_node"></a>
<strong>view_node</strong>
</dt>
<dd>
Scroll view node
<ul>
<li><span class="parameter">view_node</span>
<span class="types"><span class="type">node</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "content_node"></a>
<strong>content_node</strong>
</dt>
<dd>
Scroll content node
<ul>
<li><span class="parameter">content_node</span>
<span class="types"><span class="type">node</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>
</li>
</ul>
</dd>
<dt>
<a name = "inertion"></a>
<strong>inertion</strong>
</dt>
<dd>
Current inert speed
<ul>
<li><span class="parameter">inertion</span>
<span class="types"><span class="type">vector3</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "position"></a>
<strong>position</strong>
</dt>
<dd>
Current scroll posisition
<ul>
<li><span class="parameter">position</span>
<span class="types"><span class="type">vector3</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "target_position"></a>
<strong>target_position</strong>
</dt>
<dd>
Current scroll target position
<ul>
<li><span class="parameter">target_position</span>
<span class="types"><span class="type">vector3</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "available_pos"></a>
<strong>available_pos</strong>
</dt>
<dd>
Available position for content node: (min_x, max_y, max_x, min_y)
<ul>
<li><span class="parameter">available_pos</span>
<span class="types"><span class="type">vector4</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "available_size"></a>
<strong>available_size</strong>
</dt>
<dd>
Size of available positions: (width, height, 0)
<ul>
<li><span class="parameter">available_size</span>
<span class="types"><span class="type">vector3</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "drag"></a>
<strong>drag</strong>
</dt>
<dd>
Drag Druid component
<ul>
<li><span class="parameter">drag</span>
<span class="types"><span class="type">Drag</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "selected"></a>
<strong>selected</strong>
</dt>
<dd>
Current index of points of interests
<ul>
<li><span class="parameter">selected</span>
<span class="types"><span class="type">number</span></span>
(<em>optional</em>)
</li>
</ul>
</dd>
</dl>
@ -725,7 +1008,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -33,83 +33,94 @@
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><strong>druid.slider</strong></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><strong>Slider</strong></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.slider</code></h1>
<h1>Module <code>Slider</code></h1>
<p>Druid slider component</p>
<p>
</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, end_pos[, callback])</a></td>
<td class="name" nowrap><a href="#init">init(self, node, end_pos[, callback])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set">set(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>
<td class="name" nowrap><a href="#set_steps">set_steps(steps)</a></td>
<td class="name" nowrap><a href="#set_steps">set_steps(self, steps)</a></td>
<td class="summary">Set slider steps.</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
<td class="name" nowrap><a href="#on_change_value">on_change_value</a></td>
<td class="summary">On change value callback(self, value)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
<td class="name" nowrap><a href="#node">node</a></td>
<td class="summary">Slider pin node</td>
</tr>
<tr>
<td class="name" nowrap><a href="#start_pos">start_pos</a></td>
<td class="summary">Start pin node position</td>
</tr>
<tr>
<td class="name" nowrap><a href="#pos">pos</a></td>
<td class="summary">Current pin node position</td>
</tr>
<tr>
<td class="name" nowrap><a href="#target_pos">target_pos</a></td>
<td class="summary">Targer pin node position</td>
</tr>
<tr>
<td class="name" nowrap><a href="#end_pos">end_pos</a></td>
<td class="summary">End pin node position</td>
</tr>
<tr>
<td class="name" nowrap><a href="#dist">dist</a></td>
<td class="summary">Length between start and end position</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_drag">is_drag</a></td>
<td class="summary">Current drag state</td>
</tr>
</table>
@ -122,7 +133,7 @@
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, end_pos[, callback])</strong>
<strong>init(self, node, end_pos[, callback])</strong>
</dt>
<dd>
Component init function
@ -130,8 +141,12 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Slider</span></span>
</li>
<li><span class="parameter">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>
Gui pin node
</li>
<li><span class="parameter">end_pos</span>
@ -152,7 +167,7 @@
</dd>
<dt>
<a name = "set"></a>
<strong>set(value[, is_silent])</strong>
<strong>set(self, value[, is_silent])</strong>
</dt>
<dd>
Set value for slider
@ -160,6 +175,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Slider</span></span>
</li>
<li><span class="parameter">value</span>
<span class="types"><span class="type">number</span></span>
Value from 0 to 1
@ -178,7 +197,7 @@
</dd>
<dt>
<a name = "set_steps"></a>
<strong>set_steps(steps)</strong>
<strong>set_steps(self, steps)</strong>
</dt>
<dd>
Set slider steps. Pin node will
@ -187,6 +206,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Slider</span></span>
</li>
<li><span class="parameter">steps</span>
<span class="types"><span class="type">number[]</span></span>
Array of steps
@ -203,22 +226,21 @@
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
<a name = "on_change_value"></a>
<strong>on_change_value</strong>
</dt>
<dd>
Component events
On change value callback(self, value)
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_change_value</span>
<span class="types"><span class="type">druid_event</span></span>
On change value callback
</li>
</ul>
@ -228,46 +250,137 @@
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
<a name = "node"></a>
<strong>node</strong>
</dt>
<dd>
Component fields
Slider pin node
<h3>Fields:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Slider pin node
<span class="types"><a class="type" href="../modules/Slider.html#node">node</a></span>
</li>
</ul>
</dd>
<dt>
<a name = "start_pos"></a>
<strong>start_pos</strong>
</dt>
<dd>
Start pin node position
<ul>
<li><span class="parameter">start_pos</span>
<span class="types"><span class="type">vector3</span></span>
Start pin node position
</li>
</ul>
</dd>
<dt>
<a name = "pos"></a>
<strong>pos</strong>
</dt>
<dd>
Current pin node position
<ul>
<li><span class="parameter">pos</span>
<span class="types"><span class="type">vector3</span></span>
Current pin node position
</li>
</ul>
</dd>
<dt>
<a name = "target_pos"></a>
<strong>target_pos</strong>
</dt>
<dd>
Targer pin node position
<ul>
<li><span class="parameter">target_pos</span>
<span class="types"><span class="type">vector3</span></span>
Targer pin node position
</li>
</ul>
</dd>
<dt>
<a name = "end_pos"></a>
<strong>end_pos</strong>
</dt>
<dd>
End pin node position
<ul>
<li><span class="parameter">end_pos</span>
<span class="types"><span class="type">vector3</span></span>
End pin node position
</li>
</ul>
</dd>
<dt>
<a name = "dist"></a>
<strong>dist</strong>
</dt>
<dd>
Length between start and end position
<ul>
<li><span class="parameter">dist</span>
<span class="types"><span class="type">number</span></span>
Length between start and end position
</li>
</ul>
</dd>
<dt>
<a name = "is_drag"></a>
<strong>is_drag</strong>
</dt>
<dd>
Current drag state
<ul>
<li><span class="parameter">is_drag</span>
<span class="types"><span class="type">bool</span></span>
Current drag state
</li>
<li><span class="parameter">value</span>
<span class="types"><span class="type">number</span></span>
Current slider value
</li>
</ul>
@ -283,7 +396,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -33,113 +33,139 @@
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><strong>druid.static_grid</strong></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><strong>StaticGrid</strong></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.static_grid</code></h1>
<h1>Module <code>StaticGrid</code></h1>
<p>Component to handle placing components by row and columns.</p>
<p> Grid can anchor your elements, get content size and other</p>
<p>
Grid can anchor your elements, get content size and other</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(parent, element[, in_row=1])</a></td>
<td class="name" nowrap><a href="#init">init(self, parent, element[, in_row=1])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_pos">get_pos(index)</a></td>
<td class="name" nowrap><a href="#get_pos">get_pos(self, index)</a></td>
<td class="summary">Return pos for grid node index</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_index">get_index(pos)</a></td>
<td class="name" nowrap><a href="#get_index">get_index(self, pos)</a></td>
<td class="summary">Return index for grid pos</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_index_by_node">get_index_by_node(node)</a></td>
<td class="name" nowrap><a href="#get_index_by_node">get_index_by_node(self, node)</a></td>
<td class="summary">Return grid index by node</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_anchor">set_anchor(anchor)</a></td>
<td class="name" nowrap><a href="#set_anchor">set_anchor(self, anchor)</a></td>
<td class="summary">Set grid anchor.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#add">add(item[, index])</a></td>
<td class="name" nowrap><a href="#add">add(self, item[, index])</a></td>
<td class="summary">Add new item to the grid</td>
</tr>
<tr>
<td class="name" nowrap><a href="#remove">remove(index, is_shift_nodes)</a></td>
<td class="name" nowrap><a href="#remove">remove(self, index, is_shift_nodes)</a></td>
<td class="summary">Remove the item from the grid.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_size">get_size()</a></td>
<td class="name" nowrap><a href="#get_size">get_size(self)</a></td>
<td class="summary">Return grid content size</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_all_pos">get_all_pos()</a></td>
<td class="name" nowrap><a href="#get_all_pos">get_all_pos(self)</a></td>
<td class="summary">Return array of all node positions</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_position_function">set_position_function(callback)</a></td>
<td class="name" nowrap><a href="#set_position_function">set_position_function(self, callback)</a></td>
<td class="summary">Change set position function for grid nodes.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#clear">clear()</a></td>
<td class="name" nowrap><a href="#clear">clear(self)</a></td>
<td class="summary">Clear grid nodes array.</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
<td class="name" nowrap><a href="#on_add_item">on_add_item</a></td>
<td class="summary">On item add callback(self, node, index)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
<td class="name" nowrap><a href="#on_remove_item">on_remove_item</a></td>
<td class="summary">On item remove callback(self, index)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_change_items">on_change_items</a></td>
<td class="summary">On item add or remove callback(self, index)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_clear">on_clear</a></td>
<td class="summary">On grid clear callback(self)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_update_positions">on_update_positions</a></td>
<td class="summary">On update item positions callback(self)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#parent">parent</a></td>
<td class="summary">Parent gui node</td>
</tr>
<tr>
<td class="name" nowrap><a href="#nodes">nodes</a></td>
<td class="summary">List of all grid nodes</td>
</tr>
<tr>
<td class="name" nowrap><a href="#first_index">first_index</a></td>
<td class="summary">The first index of node in grid</td>
</tr>
<tr>
<td class="name" nowrap><a href="#last_index">last_index</a></td>
<td class="summary">The last index of node in grid</td>
</tr>
<tr>
<td class="name" nowrap><a href="#anchor">anchor</a></td>
<td class="summary">Item anchor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#node_size">node_size</a></td>
<td class="summary">Item size</td>
</tr>
</table>
@ -152,7 +178,7 @@
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(parent, element[, in_row=1])</strong>
<strong>init(self, parent, element[, in_row=1])</strong>
</dt>
<dd>
Component init function
@ -160,6 +186,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">StaticGrid</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
@ -182,7 +212,7 @@
</dd>
<dt>
<a name = "get_pos"></a>
<strong>get_pos(index)</strong>
<strong>get_pos(self, index)</strong>
</dt>
<dd>
Return pos for grid node index
@ -190,6 +220,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">StaticGrid</span></span>
</li>
<li><span class="parameter">index</span>
<span class="types"><span class="type">number</span></span>
The grid element index
@ -209,7 +243,7 @@
</dd>
<dt>
<a name = "get_index"></a>
<strong>get_index(pos)</strong>
<strong>get_index(self, pos)</strong>
</dt>
<dd>
Return index for grid pos
@ -217,6 +251,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">StaticGrid</span></span>
</li>
<li><span class="parameter">pos</span>
<span class="types"><span class="type">vector3</span></span>
The node position in the grid
@ -236,7 +274,7 @@
</dd>
<dt>
<a name = "get_index_by_node"></a>
<strong>get_index_by_node(node)</strong>
<strong>get_index_by_node(self, node)</strong>
</dt>
<dd>
Return grid index by node
@ -244,6 +282,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">StaticGrid</span></span>
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
The gui node in the grid
@ -263,7 +305,7 @@
</dd>
<dt>
<a name = "set_anchor"></a>
<strong>set_anchor(anchor)</strong>
<strong>set_anchor(self, anchor)</strong>
</dt>
<dd>
Set grid anchor. Default anchor is equal to anchor of grid parent node
@ -271,6 +313,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">StaticGrid</span></span>
</li>
<li><span class="parameter">anchor</span>
<span class="types"><span class="type">vector3</span></span>
Anchor
@ -284,7 +330,7 @@
</dd>
<dt>
<a name = "add"></a>
<strong>add(item[, index])</strong>
<strong>add(self, item[, index])</strong>
</dt>
<dd>
Add new item to the grid
@ -292,6 +338,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">StaticGrid</span></span>
</li>
<li><span class="parameter">item</span>
<span class="types"><span class="type">node</span></span>
Gui node
@ -310,7 +360,7 @@
</dd>
<dt>
<a name = "remove"></a>
<strong>remove(index, is_shift_nodes)</strong>
<strong>remove(self, index, is_shift_nodes)</strong>
</dt>
<dd>
Remove the item from the grid. Note that gui node will be not deleted
@ -318,6 +368,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">StaticGrid</span></span>
</li>
<li><span class="parameter">index</span>
<span class="types"><span class="type">number</span></span>
The grid node index to remove
@ -335,12 +389,19 @@
</dd>
<dt>
<a name = "get_size"></a>
<strong>get_size()</strong>
<strong>get_size(self)</strong>
</dt>
<dd>
Return grid content size
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">StaticGrid</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
@ -355,12 +416,19 @@
</dd>
<dt>
<a name = "get_all_pos"></a>
<strong>get_all_pos()</strong>
<strong>get_all_pos(self)</strong>
</dt>
<dd>
Return array of all node positions
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">StaticGrid</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
@ -375,7 +443,7 @@
</dd>
<dt>
<a name = "set_position_function"></a>
<strong>set_position_function(callback)</strong>
<strong>set_position_function(self, callback)</strong>
</dt>
<dd>
Change set position function for grid nodes. It will call on
@ -384,6 +452,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">StaticGrid</span></span>
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Function on node set position
@ -403,13 +475,20 @@
</dd>
<dt>
<a name = "clear"></a>
<strong>clear()</strong>
<strong>clear(self)</strong>
</dt>
<dd>
Clear grid nodes array. GUI nodes will be not deleted!
If you want to delete GUI nodes, use static_grid.nodes array before grid:clear
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">StaticGrid</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
@ -423,38 +502,21 @@
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
<a name = "on_add_item"></a>
<strong>on_add_item</strong>
</dt>
<dd>
Component events
On item add callback(self, node, index)
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_add_item</span>
<span class="types"><span class="type">druid_event</span></span>
On item add callback
</li>
<li><span class="parameter">on_remove_item</span>
<span class="types"><span class="type">druid_event</span></span>
On item remove callback
</li>
<li><span class="parameter">on_change_items</span>
<span class="types"><span class="type">druid_event</span></span>
On item add or remove callback
</li>
<li><span class="parameter">on_clear</span>
<span class="types"><span class="type">druid_event</span></span>
On grid clear callback
</li>
<li><span class="parameter">on_update_positions</span>
<span class="types"><span class="type">druid_event</span></span>
On update item positions callback
</li>
</ul>
@ -464,42 +526,197 @@
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
<a name = "on_remove_item"></a>
<strong>on_remove_item</strong>
</dt>
<dd>
Component fields
On item remove callback(self, index)
<ul>
<li><span class="parameter">on_remove_item</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_change_items"></a>
<strong>on_change_items</strong>
</dt>
<dd>
On item add or remove callback(self, index)
<ul>
<li><span class="parameter">on_change_items</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_clear"></a>
<strong>on_clear</strong>
</dt>
<dd>
On grid clear callback(self)
<ul>
<li><span class="parameter">on_clear</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_update_positions"></a>
<strong>on_update_positions</strong>
</dt>
<dd>
On update item positions callback(self)
<ul>
<li><span class="parameter">on_update_positions</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "parent"></a>
<strong>parent</strong>
</dt>
<dd>
Parent gui node
<h3>Fields:</h3>
<ul>
<li><span class="parameter">parent</span>
<span class="types"><span class="type">node</span></span>
Parent gui node
</li>
</ul>
</dd>
<dt>
<a name = "nodes"></a>
<strong>nodes</strong>
</dt>
<dd>
List of all grid nodes
<ul>
<li><span class="parameter">nodes</span>
<span class="types"><span class="type">node[]</span></span>
List of all grid nodes
</li>
</ul>
</dd>
<dt>
<a name = "first_index"></a>
<strong>first_index</strong>
</dt>
<dd>
The first index of node in grid
<ul>
<li><span class="parameter">first_index</span>
<span class="types"><span class="type">number</span></span>
The first index of node in grid
</li>
</ul>
</dd>
<dt>
<a name = "last_index"></a>
<strong>last_index</strong>
</dt>
<dd>
The last index of node in grid
<ul>
<li><span class="parameter">last_index</span>
<span class="types"><span class="type">number</span></span>
The last index of node in grid
</li>
</ul>
</dd>
<dt>
<a name = "anchor"></a>
<strong>anchor</strong>
</dt>
<dd>
Item anchor
<ul>
<li><span class="parameter">anchor</span>
<span class="types"><span class="type">vector3</span></span>
Item anchor
</li>
</ul>
</dd>
<dt>
<a name = "node_size"></a>
<strong>node_size</strong>
</dt>
<dd>
Item size
<ul>
<li><span class="parameter">node_size</span>
<span class="types"><span class="type">vector3</span></span>
Item size
</li>
<li><span class="parameter">border</span>
<span class="types"><span class="type">vector4</span></span>
The size of item content
</li>
</ul>
@ -515,7 +732,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -34,83 +34,77 @@
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><strong>druid.swipe</strong></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><strong>Swipe</strong></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.swipe</code></h1>
<h1>Module <code>Swipe</code></h1>
<p>Component to handle swipe gestures on node.</p>
<p> Swipe will be triggered, if swipe was started and
<p>
Swipe will be triggered, if swipe was started and
ended on one node</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, on_swipe_callback)</a></td>
<td class="name" nowrap><a href="#init">init(self, node, on_swipe_callback)</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_click_zone">set_click_zone(zone)</a></td>
<td class="name" nowrap><a href="#set_click_zone">set_click_zone(self, zone)</a></td>
<td class="summary">Strict swipe click area.</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Components fields</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Style">Style</a></td>
<td class="name" nowrap><a href="#style">style</a></td>
<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="#node">node</a></td>
<td class="summary">Swipe node</td>
</tr>
<tr>
<td class="name" nowrap><a href="#click_zone">click_zone</a></td>
<td class="summary">Restriction zone</td>
</tr>
</table>
<br/>
<br/>
@ -121,7 +115,7 @@
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, on_swipe_callback)</strong>
<strong>init(self, node, on_swipe_callback)</strong>
</dt>
<dd>
Component init function
@ -129,13 +123,17 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Swipe</span></span>
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
<span class="types"><a class="type" href="../modules/Swipe.html#node">node</a></span>
Gui node
</li>
<li><span class="parameter">on_swipe_callback</span>
<span class="types"><span class="type">function</span></span>
Swipe callback for on<em>swipe</em>end event
Swipe callback for on_swipe_end event
</li>
</ul>
@ -146,7 +144,7 @@
</dd>
<dt>
<a name = "set_click_zone"></a>
<strong>set_click_zone(zone)</strong>
<strong>set_click_zone(self, zone)</strong>
</dt>
<dd>
Strict swipe click area. Useful for
@ -155,8 +153,12 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Swipe</span></span>
</li>
<li><span class="parameter">zone</span>
<span class="types"><span class="type">node</span></span>
<span class="types"><a class="type" href="../modules/Swipe.html#node">node</a></span>
Gui node
</li>
</ul>
@ -171,55 +173,8 @@
<dl class="function">
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Components fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Swipe node
</li>
<li><span class="parameter">click_zone</span>
<span class="types"><span class="type">node</span></span>
Restriction zone
(<em>optional</em>)
</li>
</ul>
</dd>
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_swipe</span>
<span class="types"><span class="type">druid_event</span></span>
Trigger on swipe event
</li>
</ul>
</dd>
<dt>
<a name = "Style"></a>
<strong>Style</strong>
<a name = "style"></a>
<strong>style</strong>
</dt>
<dd>
Component style params.
@ -250,6 +205,51 @@
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "node"></a>
<strong>node</strong>
</dt>
<dd>
Swipe node
<ul>
<li><span class="parameter">node</span>
<span class="types"><a class="type" href="../modules/Swipe.html#node">node</a></span>
</li>
</ul>
</dd>
<dt>
<a name = "click_zone"></a>
<strong>click_zone</strong>
</dt>
<dd>
Restriction zone
<ul>
<li><span class="parameter">click_zone</span>
<span class="types"><a class="type" href="../modules/Swipe.html#node">node</a></span>
(<em>optional</em>)
</li>
</ul>
</dd>
</dl>
@ -258,7 +258,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -33,102 +33,124 @@
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><strong>druid.text</strong></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><strong>Text</strong></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.text</code></h1>
<h1>Module <code>Text</code></h1>
<p>Component to handle all GUI texts.</p>
<p> Druid text can adjust itself for text node size
<p>
Druid text can adjust itself for text node size
Text will never will be outside of his text size (even multiline)</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node[, value[, no_adjust]])</a></td>
<td class="name" nowrap><a href="#init">init(self, node[, value[, no_adjust]])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_text_width">get_text_width([text])</a></td>
<td class="name" nowrap><a href="#get_text_width">get_text_width(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="#set_to">set_to(set_to)</a></td>
<td class="name" nowrap><a href="#set_to">set_to(self, set_to)</a></td>
<td class="summary">Set text to text field</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_color">set_color(color)</a></td>
<td class="name" nowrap><a href="#set_color">set_color(self, color)</a></td>
<td class="summary">Set color</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_alpha">set_alpha(alpha)</a></td>
<td class="name" nowrap><a href="#set_alpha">set_alpha(self, alpha)</a></td>
<td class="summary">Set alpha</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_scale">set_scale(scale)</a></td>
<td class="name" nowrap><a href="#set_scale">set_scale(self, scale)</a></td>
<td class="summary">Set scale</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_pivot">set_pivot(pivot)</a></td>
<td class="name" nowrap><a href="#set_pivot">set_pivot(self, pivot)</a></td>
<td class="summary">Set text pivot.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_multiline">is_multiline()</a></td>
<td class="name" nowrap><a href="#is_multiline">is_multiline(self)</a></td>
<td class="summary">Return true, if text with line break</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
<td class="name" nowrap><a href="#on_set_text">on_set_text</a></td>
<td class="summary">On set text callback(self, text)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
<td class="name" nowrap><a href="#on_update_text_scale">on_update_text_scale</a></td>
<td class="summary">On adjust text size callback(self, new_scale)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_set_pivot">on_set_pivot</a></td>
<td class="summary">On change pivot callback(self, pivot)</td>
</tr>
<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="#pos">pos</a></td>
<td class="summary">Current text position</td>
</tr>
<tr>
<td class="name" nowrap><a href="#start_scale">start_scale</a></td>
<td class="summary">Initial text node scale</td>
</tr>
<tr>
<td class="name" nowrap><a href="#scale">scale</a></td>
<td class="summary">Current text node scale</td>
</tr>
<tr>
<td class="name" nowrap><a href="#start_size">start_size</a></td>
<td class="summary">Initial text node size</td>
</tr>
<tr>
<td class="name" nowrap><a href="#text_area">text_area</a></td>
<td class="summary">Current text node available are</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_no_adjust">is_no_adjust</a></td>
<td class="summary">Current text size adjust settings</td>
</tr>
</table>
@ -141,7 +163,7 @@
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node[, value[, no_adjust]])</strong>
<strong>init(self, node[, value[, no_adjust]])</strong>
</dt>
<dd>
Component init function
@ -149,8 +171,12 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Text</span></span>
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
<span class="types"><a class="type" href="../modules/Text.html#node">node</a></span>
Gui text node
</li>
<li><span class="parameter">value</span>
@ -172,7 +198,7 @@
</dd>
<dt>
<a name = "get_text_width"></a>
<strong>get_text_width([text])</strong>
<strong>get_text_width(self[, text])</strong>
</dt>
<dd>
Calculate text width with font with respect to trailing space
@ -180,11 +206,13 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Text</span></span>
</li>
<li><span class="parameter">text</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
(<em>optional</em>)
</li>
</ul>
@ -196,7 +224,7 @@
</dd>
<dt>
<a name = "set_to"></a>
<strong>set_to(set_to)</strong>
<strong>set_to(self, set_to)</strong>
</dt>
<dd>
Set text to text field
@ -204,6 +232,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Text</span></span>
</li>
<li><span class="parameter">set_to</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Text for node
@ -217,7 +249,7 @@
</dd>
<dt>
<a name = "set_color"></a>
<strong>set_color(color)</strong>
<strong>set_color(self, color)</strong>
</dt>
<dd>
Set color
@ -225,6 +257,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Text</span></span>
</li>
<li><span class="parameter">color</span>
<span class="types"><span class="type">vector4</span></span>
Color for node
@ -238,7 +274,7 @@
</dd>
<dt>
<a name = "set_alpha"></a>
<strong>set_alpha(alpha)</strong>
<strong>set_alpha(self, alpha)</strong>
</dt>
<dd>
Set alpha
@ -246,6 +282,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Text</span></span>
</li>
<li><span class="parameter">alpha</span>
<span class="types"><span class="type">number</span></span>
Alpha for node
@ -259,7 +299,7 @@
</dd>
<dt>
<a name = "set_scale"></a>
<strong>set_scale(scale)</strong>
<strong>set_scale(self, scale)</strong>
</dt>
<dd>
Set scale
@ -267,6 +307,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Text</span></span>
</li>
<li><span class="parameter">scale</span>
<span class="types"><span class="type">vector3</span></span>
Scale for node
@ -280,7 +324,7 @@
</dd>
<dt>
<a name = "set_pivot"></a>
<strong>set_pivot(pivot)</strong>
<strong>set_pivot(self, pivot)</strong>
</dt>
<dd>
Set text pivot. Text will re-anchor inside
@ -289,6 +333,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Text</span></span>
</li>
<li><span class="parameter">pivot</span>
<span class="types"><span class="type">gui.pivot</span></span>
Gui pivot constant
@ -302,12 +350,19 @@
</dd>
<dt>
<a name = "is_multiline"></a>
<strong>is_multiline()</strong>
<strong>is_multiline(self)</strong>
</dt>
<dd>
Return true, if text with line break
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Text</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
@ -321,30 +376,21 @@
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
<a name = "on_set_text"></a>
<strong>on_set_text</strong>
</dt>
<dd>
Component events
On set text callback(self, text)
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_set_text</span>
<span class="types"><span class="type">druid_event</span></span>
On set text callback
</li>
<li><span class="parameter">on_update_text_scale</span>
<span class="types"><span class="type">druid_event</span></span>
On adjust text size callback
</li>
<li><span class="parameter">on_set_pivot</span>
<span class="types"><span class="type">druid_event</span></span>
On change pivot callback
</li>
</ul>
@ -354,46 +400,177 @@
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
<a name = "on_update_text_scale"></a>
<strong>on_update_text_scale</strong>
</dt>
<dd>
Component fields
On adjust text size callback(self, new_scale)
<ul>
<li><span class="parameter">on_update_text_scale</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_set_pivot"></a>
<strong>on_set_pivot</strong>
</dt>
<dd>
On change pivot callback(self, pivot)
<ul>
<li><span class="parameter">on_set_pivot</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "node"></a>
<strong>node</strong>
</dt>
<dd>
Text node
<h3>Fields:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Text node
<span class="types"><a class="type" href="../modules/Text.html#node">node</a></span>
</li>
</ul>
</dd>
<dt>
<a name = "pos"></a>
<strong>pos</strong>
</dt>
<dd>
Current text position
<ul>
<li><span class="parameter">pos</span>
<span class="types"><span class="type">vector3</span></span>
Current text position
</li>
</ul>
</dd>
<dt>
<a name = "start_scale"></a>
<strong>start_scale</strong>
</dt>
<dd>
Initial text node scale
<ul>
<li><span class="parameter">start_scale</span>
<span class="types"><span class="type">vector3</span></span>
Initial text node scale
</li>
</ul>
</dd>
<dt>
<a name = "scale"></a>
<strong>scale</strong>
</dt>
<dd>
Current text node scale
<ul>
<li><span class="parameter">scale</span>
<span class="types"><span class="type">vector3</span></span>
Current text node scale
</li>
</ul>
</dd>
<dt>
<a name = "start_size"></a>
<strong>start_size</strong>
</dt>
<dd>
Initial text node size
<ul>
<li><span class="parameter">start_size</span>
<span class="types"><span class="type">vector3</span></span>
Initial text node size
</li>
</ul>
</dd>
<dt>
<a name = "text_area"></a>
<strong>text_area</strong>
</dt>
<dd>
Current text node available are
<ul>
<li><span class="parameter">text_area</span>
<span class="types"><span class="type">vector3</span></span>
Current text node available are
</li>
</ul>
</dd>
<dt>
<a name = "is_no_adjust"></a>
<strong>is_no_adjust</strong>
</dt>
<dd>
Current text size adjust settings
<ul>
<li><span class="parameter">is_no_adjust</span>
<span class="types"><span class="type">bool</span></span>
Current text size adjust settings
</li>
<li><span class="parameter">color</span>
<span class="types"><span class="type">vector3</span></span>
Current text color
</li>
</ul>
@ -409,7 +586,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -33,86 +33,92 @@
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><strong>druid.timer</strong></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><strong>Timer</strong></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.timer</code></h1>
<h1>Module <code>Timer</code></h1>
<p>Component to handle GUI timers.</p>
<p> Timer updating by game delta time. If game is not focused -
<p>
Timer updating by game delta time. If game is not focused -
timer will be not updated.</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, seconds_from[, seconds_to=0[, callback]])</a></td>
<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>
</tr>
<tr>
<td class="name" nowrap><a href="#set_to">set_to(set_to)</a></td>
<td class="name" nowrap><a href="#set_to">set_to(self, set_to)</a></td>
<td class="summary">Set text to text field</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_state">set_state(is_on)</a></td>
<td class="name" nowrap><a href="#set_state">set_state(self, is_on)</a></td>
<td class="summary">Called when update</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_interval">set_interval(from, to)</a></td>
<td class="name" nowrap><a href="#set_interval">set_interval(self, from, to)</a></td>
<td class="summary">Set time interval</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
<td class="name" nowrap><a href="#on_tick">on_tick</a></td>
<td class="summary">On timer tick.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
<td class="name" nowrap><a href="#on_set_enabled">on_set_enabled</a></td>
<td class="summary">On timer change enabled state callback(self, is_enabled)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_timer_end">on_timer_end</a></td>
<td class="summary">On timer end callback</td>
</tr>
<tr>
<td class="name" nowrap><a href="#node">node</a></td>
<td class="summary">Trigger node</td>
</tr>
<tr>
<td class="name" nowrap><a href="#from">from</a></td>
<td class="summary">Initial timer value</td>
</tr>
<tr>
<td class="name" nowrap><a href="#target">target</a></td>
<td class="summary">Target timer value</td>
</tr>
</table>
@ -125,7 +131,7 @@
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, seconds_from[, seconds_to=0[, callback]])</strong>
<strong>init(self, node, seconds_from[, seconds_to=0[, callback]])</strong>
</dt>
<dd>
Component init function
@ -133,8 +139,12 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Timer</span></span>
</li>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
<span class="types"><a class="type" href="../modules/Timer.html#node">node</a></span>
Gui text node
</li>
<li><span class="parameter">seconds_from</span>
@ -160,7 +170,7 @@
</dd>
<dt>
<a name = "set_to"></a>
<strong>set_to(set_to)</strong>
<strong>set_to(self, set_to)</strong>
</dt>
<dd>
Set text to text field
@ -168,6 +178,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Timer</span></span>
</li>
<li><span class="parameter">set_to</span>
<span class="types"><span class="type">number</span></span>
Value in seconds
@ -181,7 +195,7 @@
</dd>
<dt>
<a name = "set_state"></a>
<strong>set_state(is_on)</strong>
<strong>set_state(self, is_on)</strong>
</dt>
<dd>
Called when update
@ -189,6 +203,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Timer</span></span>
</li>
<li><span class="parameter">is_on</span>
<span class="types"><span class="type">bool</span></span>
Timer enable state
@ -202,7 +220,7 @@
</dd>
<dt>
<a name = "set_interval"></a>
<strong>set_interval(from, to)</strong>
<strong>set_interval(self, from, to)</strong>
</dt>
<dd>
Set time interval
@ -210,6 +228,10 @@
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Timer</span></span>
</li>
<li><span class="parameter">from</span>
<span class="types"><span class="type">number</span></span>
Start time in seconds
@ -226,30 +248,21 @@
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
<a name = "on_tick"></a>
<strong>on_tick</strong>
</dt>
<dd>
Component events
On timer tick. Fire every second callback(self, value)
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_tick</span>
<span class="types"><span class="type">druid_event</span></span>
On timer tick callback. Fire every second
</li>
<li><span class="parameter">on_set_enabled</span>
<span class="types"><span class="type">druid_event</span></span>
On timer change enabled state callback
</li>
<li><span class="parameter">on_timer_end</span>
<span class="types"><span class="type">druid_event</span></span>
On timer end callback
</li>
</ul>
@ -259,30 +272,97 @@
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
<a name = "on_set_enabled"></a>
<strong>on_set_enabled</strong>
</dt>
<dd>
Component fields
On timer change enabled state callback(self, is_enabled)
<ul>
<li><span class="parameter">on_set_enabled</span>
<span class="types"><span class="type">druid_event</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "on_timer_end"></a>
<strong>on_timer_end</strong>
</dt>
<dd>
On timer end callback
<ul>
<li><span class="parameter">on_timer_end</span>
<span class="types"><span class="type">druid_event</span></span>
(self, Timer)
</li>
</ul>
</dd>
<dt>
<a name = "node"></a>
<strong>node</strong>
</dt>
<dd>
Trigger node
<h3>Fields:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Trigger node
<span class="types"><a class="type" href="../modules/Timer.html#node">node</a></span>
</li>
</ul>
</dd>
<dt>
<a name = "from"></a>
<strong>from</strong>
</dt>
<dd>
Initial timer value
<ul>
<li><span class="parameter">from</span>
<span class="types"><span class="type">number</span></span>
Initial timer value
</li>
</ul>
</dd>
<dt>
<a name = "target"></a>
<strong>target</strong>
</dt>
<dd>
Target timer value
<ul>
<li><span class="parameter">target</span>
<span class="types"><span class="type">number</span></span>
Target timer value
</li>
<li><span class="parameter">value</span>
<span class="types"><span class="type">number</span></span>
Current timer value
</li>
</ul>
@ -298,7 +378,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -1,601 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><strong>component</strong></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>component</code></h1>
<p>Basic class for all Druid components.</p>
<p> To create you component, use <a href="../modules/component.html#Component.create">component.create</a></p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#set_style">set_style(style)</a></td>
<td class="summary">Set current component style table.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_template">set_template(template)</a></td>
<td class="summary">Set current component template name</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_nodes">set_nodes(nodes)</a></td>
<td class="summary">Set current component nodes</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_context">get_context()</a></td>
<td class="summary">Get current component context</td>
</tr>
<tr>
<td class="name" nowrap><a href="#increase_input_priority">increase_input_priority()</a></td>
<td class="summary">Increase input priority in current input stack</td>
</tr>
<tr>
<td class="name" nowrap><a href="#reset_input_priority">reset_input_priority()</a></td>
<td class="summary">Reset input priority in current input stack</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_node">get_node(node_or_name)</a></td>
<td class="summary">Get node for component by name.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_druid">get_druid()</a></td>
<td class="summary">Return druid with context of calling component.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_name">get_name()</a></td>
<td class="summary">Return component name</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_input_enabled">set_input_enabled(state)</a></td>
<td class="summary">Set component input state.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_parent_component">get_parent_component()</a></td>
<td class="summary">Return the parent for current component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#setup_component">setup_component(table, table, table)</a></td>
<td class="summary">Setup component context and his style table</td>
</tr>
<tr>
<td class="name" nowrap><a href="#__set_context">__set_context(context)</a></td>
<td class="summary">Set current component context</td>
</tr>
<tr>
<td class="name" nowrap><a href="#__get_interests">__get_interests()</a></td>
<td class="summary">Get current component interests</td>
</tr>
<tr>
<td class="name" nowrap><a href="#__get_template">__get_template()</a></td>
<td class="summary">Get current component template name</td>
</tr>
<tr>
<td class="name" nowrap><a href="#__get_nodes">__get_nodes()</a></td>
<td class="summary">Get current component nodes</td>
</tr>
<tr>
<td class="name" nowrap><a href="#__add_children">__add_children(children)</a></td>
<td class="summary">Add child to component children list</td>
</tr>
<tr>
<td class="name" nowrap><a href="#__remove_children">__remove_children(children)</a></td>
<td class="summary">Remove child from component children list</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Component.create">Component.create(name[, interest={}])</a></td>
<td class="summary">Create new component.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "set_style"></a>
<strong>set_style(style)</strong>
</dt>
<dd>
Set current component style table.
Invoke <code>on_style_change</code> on component, if exist. Component should handle
their style changing and store all style params
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">style</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Druid style module
</li>
</ul>
</dd>
<dt>
<a name = "set_template"></a>
<strong>set_template(template)</strong>
</dt>
<dd>
Set current component template name
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">template</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Component template name
</li>
</ul>
</dd>
<dt>
<a name = "set_nodes"></a>
<strong>set_nodes(nodes)</strong>
</dt>
<dd>
Set current component nodes
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">nodes</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component nodes table
</li>
</ul>
</dd>
<dt>
<a name = "get_context"></a>
<strong>get_context()</strong>
</dt>
<dd>
Get current component context
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component context
</ol>
</dd>
<dt>
<a name = "increase_input_priority"></a>
<strong>increase_input_priority()</strong>
</dt>
<dd>
Increase input priority in current input stack
</dd>
<dt>
<a name = "reset_input_priority"></a>
<strong>reset_input_priority()</strong>
</dt>
<dd>
Reset input priority in current input stack
</dd>
<dt>
<a name = "get_node"></a>
<strong>get_node(node_or_name)</strong>
</dt>
<dd>
Get node for component by name.
If component has nodes, node<em>or</em>name should be string
It auto pick node by template name or from nodes by clone<em>tree
if they was setup via component:set</em>nodes, component:set_template
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node_or_name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a> or <span class="type">node</span></span>
Node name or node itself
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">node</span></span>
Gui node
</ol>
</dd>
<dt>
<a name = "get_druid"></a>
<strong>get_druid()</strong>
</dt>
<dd>
Return druid with context of calling component.
Use it to create component inside of other components.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Druid</span></span>
Druid instance with component context
</ol>
</dd>
<dt>
<a name = "get_name"></a>
<strong>get_name()</strong>
</dt>
<dd>
Return component name
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
The component name
</ol>
</dd>
<dt>
<a name = "set_input_enabled"></a>
<strong>set_input_enabled(state)</strong>
</dt>
<dd>
Set component input state. By default it enabled
You can disable any input of component by this function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
The component input state
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
Component itself
</ol>
</dd>
<dt>
<a name = "get_parent_component"></a>
<strong>get_parent_component()</strong>
</dt>
<dd>
Return the parent for current component
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span> or <span class="type">nil</span></span>
The druid component instance or nil
</ol>
</dd>
<dt>
<a name = "setup_component"></a>
<strong>setup_component(table, table, table)</strong>
</dt>
<dd>
Setup component context and his style table
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">table</span>
<span class="types"><span class="type">style</span></span>
Druid style module
</li>
<li><span class="parameter">table</span>
<span class="types"><span class="type">style</span></span>
Druid style module
</li>
<li><span class="parameter">table</span>
<span class="types"><span class="type">style</span></span>
Druid style module
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">component</span></span>
Component itself
</ol>
</dd>
<dt>
<a name = "__set_context"></a>
<strong>__set_context(context)</strong>
</dt>
<dd>
Set current component context
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">context</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Druid context. Usually it is self of script
</li>
</ul>
</dd>
<dt>
<a name = "__get_interests"></a>
<strong>__get_interests()</strong>
</dt>
<dd>
Get current component interests
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
List of component interests
</ol>
</dd>
<dt>
<a name = "__get_template"></a>
<strong>__get_template()</strong>
</dt>
<dd>
Get current component template name
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Component template name
</ol>
</dd>
<dt>
<a name = "__get_nodes"></a>
<strong>__get_nodes()</strong>
</dt>
<dd>
Get current component nodes
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component nodes table
</ol>
</dd>
<dt>
<a name = "__add_children"></a>
<strong>__add_children(children)</strong>
</dt>
<dd>
Add child to component children list
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">children</span>
<span class="types"><span class="type">component</span></span>
The druid component instance
</li>
</ul>
</dd>
<dt>
<a name = "__remove_children"></a>
<strong>__remove_children(children)</strong>
</dt>
<dd>
Remove child from component children list
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">children</span>
<span class="types"><span class="type">component</span></span>
The druid component instance
</li>
</ul>
</dd>
<dt>
<a name = "Component.create"></a>
<strong>Component.create(name[, interest={}])</strong>
</dt>
<dd>
Create new component. It will inheritance from basic
druid component.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
Component name
</li>
<li><span class="parameter">interest</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
List of component's interest
(<em>default</em> {})
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,227 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><strong>druid.back_handler</strong></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.back_handler</code></h1>
<p>Component to handle back key (android, backspace)</p>
<p>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(callback[, Callback])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_input">on_input(action_id, action)</a></td>
<td class="summary">Input handler for component</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(callback[, Callback])</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">callback</span></span>
On back button
</li>
<li><span class="parameter">Callback</span>
<span class="types"><span class="type">params</span></span>
argument
(<em>optional</em>)
</li>
</ul>
</dd>
<dt>
<a name = "on_input"></a>
<strong>on_input(action_id, action)</strong>
</dt>
<dd>
Input handler for component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">action_id</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
on_input action id
</li>
<li><span class="parameter">action</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
on_input action
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_back</span>
<span class="types"><span class="type">druid_event</span></span>
On back handler callback
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">params</span>
<span class="types"><span class="type">any</span></span>
Params to click callbacks
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,246 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><strong>druid.blocker</strong></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.blocker</code></h1>
<p>Component to block input on specify zone by node</p>
<p>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node)</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_enabled">set_enabled(state)</a></td>
<td class="summary">Set enabled blocker component state</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_enabled">is_enabled()</a></td>
<td class="summary">Return blocked enabled state</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node)</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
</ul>
</dd>
<dt>
<a name = "set_enabled"></a>
<strong>set_enabled(state)</strong>
</dt>
<dd>
Set enabled blocker component state
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">state</span>
<span class="types"><span class="type">bool</span></span>
Enabled state
</li>
</ul>
</dd>
<dt>
<a name = "is_enabled"></a>
<strong>is_enabled()</strong>
</dt>
<dd>
Return blocked enabled state
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
True, if blocker is enabled
</ol>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_click</span>
<span class="types"><span class="type">druid_event</span></span>
On release button callback
</li>
<li><span class="parameter">on_enable_change</span>
<span class="types"><span class="type">druid_event</span></span>
On enable/disable callback
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Trigger node
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,251 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><strong>druid.checkbox_group</strong></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.checkbox_group</code></h1>
<p>Checkbox group module</p>
<p>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, callback[, click=node])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_state">set_state(indexes)</a></td>
<td class="summary">Set checkbox group state</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_state">get_state()</a></td>
<td class="summary">Return checkbox group state</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, callback[, click=node])</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node[]</span></span>
Array of gui node
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Checkbox callback
</li>
<li><span class="parameter">click</span>
<span class="types"><span class="type">node[]</span></span>
node Array of trigger nodes, by default equals to nodes
(<em>default</em> node)
</li>
</ul>
</dd>
<dt>
<a name = "set_state"></a>
<strong>set_state(indexes)</strong>
</dt>
<dd>
Set checkbox group state
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">indexes</span>
<span class="types"><span class="type">bool[]</span></span>
Array of checkbox state
</li>
</ul>
</dd>
<dt>
<a name = "get_state"></a>
<strong>get_state()</strong>
</dt>
<dd>
Return checkbox group state
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool[]</span></span>
Array if checkboxes state
</ol>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_checkbox_click</span>
<span class="types"><span class="type">druid_event</span></span>
On any checkbox click
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">checkboxes</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Array of checkbox components
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,291 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><strong>druid.drag</strong></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.drag</code></h1>
<p>Component to handle drag action on node.</p>
<p> Drag have correct handling for multitouch and swap
touched while dragging. Drag will be processed even
the cursor is outside of node, if drag is already started</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, on_drag_callback)</a></td>
<td class="summary">Drag component constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_click_zone">set_click_zone(zone)</a></td>
<td class="summary">Strict drag click area.</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Components fields</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Style">Style</a></td>
<td class="summary">Component style params.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, on_drag_callback)</strong>
</dt>
<dd>
Drag component constructor
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
GUI node to detect dragging
</li>
<li><span class="parameter">on_drag_callback</span>
<span class="types"><span class="type">function</span></span>
Callback for on<em>drag</em>event(self, dx, dy)
</li>
</ul>
</dd>
<dt>
<a name = "set_click_zone"></a>
<strong>set_click_zone(zone)</strong>
</dt>
<dd>
Strict drag click area. Useful for
restrict events outside stencil node
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">zone</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_touch_start</span>
<span class="types"><span class="type">druid_event</span></span>
(self) Event on touch start
</li>
<li><span class="parameter">on_touch_end</span>
<span class="types"><span class="type">druid_event</span></span>
(self) Event on touch end
</li>
<li><span class="parameter">on_drag_start</span>
<span class="types"><span class="type">druid_event</span></span>
(self) Event on drag start
</li>
<li><span class="parameter">on_drag</span>
<span class="types"><span class="type">druid_event</span></span>
(self, dx, dy) Event on drag progress
</li>
<li><span class="parameter">on_drag_end</span>
<span class="types"><span class="type">druid_event</span></span>
(self) Event on drag end
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Components fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">is_touch</span>
<span class="types"><span class="type">bool</span></span>
Is component now touching
</li>
<li><span class="parameter">is_drag</span>
<span class="types"><span class="type">bool</span></span>
Is component now dragging
</li>
<li><span class="parameter">can_x</span>
<span class="types"><span class="type">bool</span></span>
Is drag component process vertical dragging. Default - true
</li>
<li><span class="parameter">can_y</span>
<span class="types"><span class="type">bool</span></span>
Is drag component process horizontal. Default - true
</li>
<li><span class="parameter">x</span>
<span class="types"><span class="type">number</span></span>
Current touch x position
</li>
<li><span class="parameter">y</span>
<span class="types"><span class="type">number</span></span>
Current touch y position
</li>
<li><span class="parameter">touch_start_pos</span>
<span class="types"><span class="type">vector3</span></span>
Touch start position
</li>
</ul>
</dd>
<dt>
<a name = "Style"></a>
<strong>Style</strong>
</dt>
<dd>
Component style params.
You can override this component styles params in druid styles table
or create your own style
<h3>Fields:</h3>
<ul>
<li><span class="parameter">DRAG_DEADZONE</span>
<span class="types"><span class="type">number</span></span>
Distance in pixels to start dragging
(<em>default</em> 10)
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,381 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><strong>druid.grid</strong></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">changelog</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.grid</code></h1>
<p>Component to handle placing components by row and columns.</p>
<p> Grid can anchor your elements, get content size and other</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(parent, element[, in_row=1])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_offset">set_offset(offset)</a></td>
<td class="summary">Set grid items offset, the distance between items</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_anchor">set_anchor(acnhor)</a></td>
<td class="summary">Set grid anchor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#add">add(item[, index])</a></td>
<td class="summary">Add new item to the grid</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_size">get_size()</a></td>
<td class="summary">Return grid content size</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_all_pos">get_all_pos()</a></td>
<td class="summary">Return array of all node positions</td>
</tr>
<tr>
<td class="name" nowrap><a href="#clear">clear()</a></td>
<td class="summary">Clear grid nodes array.</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(parent, element[, in_row=1])</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<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>
<li><span class="parameter">element</span>
<span class="types"><span class="type">node</span></span>
Element prefab. Need to get it size
</li>
<li><span class="parameter">in_row</span>
<span class="types"><span class="type">number</span></span>
How many nodes in row can be placed
(<em>default</em> 1)
</li>
</ul>
</dd>
<dt>
<a name = "set_offset"></a>
<strong>set_offset(offset)</strong>
</dt>
<dd>
Set grid items offset, the distance between items
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">offset</span>
<span class="types"><span class="type">vector3</span></span>
Offset
</li>
</ul>
</dd>
<dt>
<a name = "set_anchor"></a>
<strong>set_anchor(acnhor)</strong>
</dt>
<dd>
Set grid anchor
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">acnhor</span>
<span class="types"><span class="type">vector3</span></span>
Anchor
</li>
</ul>
</dd>
<dt>
<a name = "add"></a>
<strong>add(item[, index])</strong>
</dt>
<dd>
Add new item to the grid
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">item</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
<li><span class="parameter">index</span>
<span class="types"><span class="type">number</span></span>
The item position. By default add as last item
(<em>optional</em>)
</li>
</ul>
</dd>
<dt>
<a name = "get_size"></a>
<strong>get_size()</strong>
</dt>
<dd>
Return grid content size
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">vector3</span></span>
The grid content size
</ol>
</dd>
<dt>
<a name = "get_all_pos"></a>
<strong>get_all_pos()</strong>
</dt>
<dd>
Return array of all node positions
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">vector3[]</span></span>
All grid node positions
</ol>
</dd>
<dt>
<a name = "clear"></a>
<strong>clear()</strong>
</dt>
<dd>
Clear grid nodes array. GUI nodes will be not deleted!
If you want to delete GUI nodes, use grid.nodes array before grid:clear
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_add_item</span>
<span class="types"><span class="type">druid_event</span></span>
On item add callback
</li>
<li><span class="parameter">on_remove_item</span>
<span class="types"><span class="type">druid_event</span></span>
On item remove callback
</li>
<li><span class="parameter">on_clear</span>
<span class="types"><span class="type">druid_event</span></span>
On grid clear callback
</li>
<li><span class="parameter">on_update_positions</span>
<span class="types"><span class="type">druid_event</span></span>
On update item positions callback
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">parent</span>
<span class="types"><span class="type">node</span></span>
Parent gui node
</li>
<li><span class="parameter">nodes</span>
<span class="types"><span class="type">node[]</span></span>
List of all grid nodes
</li>
<li><span class="parameter">offset</span>
<span class="types"><span class="type">vector3</span></span>
Item distance between each other items
</li>
<li><span class="parameter">anchor</span>
<span class="types"><span class="type">vector3</span></span>
Item anchor
</li>
<li><span class="parameter">node_size</span>
<span class="types"><span class="type">vector3</span></span>
Item size
</li>
<li><span class="parameter">border</span>
<span class="types"><span class="type">vector4</span></span>
The size of item content
</li>
<li><span class="parameter">border_offer</span>
<span class="types"><span class="type">vector3</span></span>
The border offset for correct anchor calculations
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-06-14 20:13:02 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -38,40 +38,29 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><strong>druid.helper</strong></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
@ -80,9 +69,7 @@
<h1>Module <code>druid.helper</code></h1>
<p>Text node or icon node can be nil</p>
<p>
</p>
<p></p>
<h2><a href="#Functions">Functions</a></h2>
@ -325,7 +312,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -38,40 +38,29 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
<li><a href="../modules/Blocker.html">Blocker</a></li>
<li><a href="../modules/Button.html">Button</a></li>
<li><a href="../modules/Drag.html">Drag</a></li>
<li><a href="../modules/Hover.html">Hover</a></li>
<li><a href="../modules/Scroll.html">Scroll</a></li>
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
<li><a href="../modules/Swipe.html">Swipe</a></li>
<li><a href="../modules/Text.html">Text</a></li>
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
<li><strong>druid</strong></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/LangText.html">LangText</a></li>
<li><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><a href="../modules/Slider.html">Slider</a></li>
<li><a href="../modules/Timer.html">Timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
</ul>
</div>
@ -81,23 +70,16 @@
<h1>Module <code>druid</code></h1>
<p>Druid UI Library.</p>
<p>
<p> Powerful Defold component based UI library. Use standart
Powerful Defold component based UI library. Use standart
components or make your own game-specific components to
make amazing GUI in your games.</p>
make amazing GUI in your games.
<p> Contains the several basic components and examples
to how to do your custom complex components to
separate UI game logic to small files</p>
<pre>
<span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="keyword">function</span> init(self)
self.druid = druid.new(self)
<span class="keyword">end</span>
</pre>
separate UI game logic to small files
<p> require("druid.druid")
function init(self)
self.druid = druid.new(self)
end
</p>
@ -153,7 +135,7 @@
<dd>
Register external druid component.
After register you can create the component with
druid<em>instance:new</em>{name}. For example <code>druid:new_button(...)</code>
druid_instance:new_{name}. For example `druid:new_button(...)`
<h3>Parameters:</h3>
@ -233,7 +215,7 @@
<dd>
Set text function
Druid locale component will call this function
to get translated text. After set<em>text</em>funtion
to get translated text. After set_text_funtion
all existing locale component will be updated
@ -279,7 +261,7 @@
</dt>
<dd>
Callback on global window event.
Used to trigger on<em>focus</em>lost and on<em>focus</em>gain
Used to trigger on_focus_lost and on_focus_gain
<h3>Parameters:</h3>
@ -331,7 +313,7 @@
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
<i style="float:right;">Last updated 2020-10-12 00:29:49 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -1,251 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><strong>druid.radio_group</strong></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid.radio_group</code></h1>
<p>Radio group module</p>
<p>
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(node, callback[, click=node])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_state">set_state(index)</a></td>
<td class="summary">Set radio group state</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_state">get_state()</a></td>
<td class="summary">Return radio group state</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Events">Events</a></td>
<td class="summary">Component events</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Fields">Fields</a></td>
<td class="summary">Component fields</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(node, callback[, click=node])</strong>
</dt>
<dd>
Component init function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node[]</span></span>
Array of gui node
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Radio callback
</li>
<li><span class="parameter">click</span>
<span class="types"><span class="type">node[]</span></span>
node Array of trigger nodes, by default equals to nodes
(<em>default</em> node)
</li>
</ul>
</dd>
<dt>
<a name = "set_state"></a>
<strong>set_state(index)</strong>
</dt>
<dd>
Set radio group state
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">index</span>
<span class="types"><span class="type">number</span></span>
Index in radio group
</li>
</ul>
</dd>
<dt>
<a name = "get_state"></a>
<strong>get_state()</strong>
</dt>
<dd>
Return radio group state
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">number</span></span>
Index in radio group
</ol>
</dd>
</dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_radio_click</span>
<span class="types"><span class="type">druid_event</span></span>
On any checkbox click
</li>
</ul>
</dd>
<dt>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
<h3>Fields:</h3>
<ul>
<li><span class="parameter">checkboxes</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Array of checkbox components
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,997 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><strong>druid_instance</strong></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>druid_instance</code></h1>
<p>Instance of Druid.</p>
<p> Make one instance per gui_script with next code:</p>
<pre>
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="keyword">function</span> init(self)
self.druid = druid.new(self)
<span class="keyword">local</span> button = self.druid:new_button(...)
<span class="keyword">end</span>
</pre>
<p> Learn Druid instance function here</p>
<h3>See also:</h3>
<ul>
<li><a href="../modules/druid.button.html#">druid.button</a></li>
<li><a href="../modules/druid.blocker.html#">druid.blocker</a></li>
<li><a href="../modules/druid.back_handler.html#">druid.back_handler</a></li>
<li><a href="../modules/druid.input.html#">druid.input</a></li>
<li><a href="../modules/druid.text.html#">druid.text</a></li>
<li><a href="../modules/druid.lang_text.html#">druid.lang_text</a></li>
<li><a href="../modules/druid.timer.html#">druid.timer</a></li>
<li><a href="../modules/druid.progress.html#">druid.progress</a></li>
<li><a href="../modules/druid.static_grid.html#">druid.static_grid</a></li>
<li><a href="../modules/druid.dynamic_grid.html#">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.scroll.html#">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html#">druid.slider</a></li>
<li><a href="../modules/druid.checkbox.html#">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html#">druid.checkbox_group</a></li>
<li><a href="../modules/druid.radio_group.html#">druid.radio_group</a></li>
<li><a href="../modules/druid.swipe.html#">druid.swipe</a></li>
<li><a href="../modules/druid.drag.html#">druid.drag</a></li>
</ul>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#druid:initialize">druid:initialize(table, table)</a></td>
<td class="summary">Druid class constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:create">druid:create(component, ...)</a></td>
<td class="summary">Create new druid component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:final">druid:final()</a></td>
<td class="summary">Call on final function on gui_script.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:remove">druid:remove(component)</a></td>
<td class="summary">Remove component from druid instance.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:update">druid:update(dt)</a></td>
<td class="summary">Druid update function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:on_input">druid:on_input(action_id, action)</a></td>
<td class="summary">Druid on_input function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:on_message">druid:on_message(message_id, message, sender)</a></td>
<td class="summary">Druid on_message function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:on_focus_lost">druid:on_focus_lost()</a></td>
<td class="summary">Druid on focus lost interest function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:on_focus_gained">druid:on_focus_gained()</a></td>
<td class="summary">Druid on focus gained interest function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:on_layout_change">druid:on_layout_change()</a></td>
<td class="summary">Druid on layout change function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid.on_language_change">druid.on_language_change()</a></td>
<td class="summary">Druid on language change.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_button">druid:new_button(...)</a></td>
<td class="summary">Create button basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_blocker">druid:new_blocker(...)</a></td>
<td class="summary">Create blocker basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_back_handler">druid:new_back_handler(...)</a></td>
<td class="summary">Create back_handler basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_hover">druid:new_hover(...)</a></td>
<td class="summary">Create hover basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_text">druid:new_text(...)</a></td>
<td class="summary">Create text basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_grid">druid:new_grid(...)</a></td>
<td class="summary">Create grid basic component
Deprecated</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_static_grid">druid:new_static_grid(...)</a></td>
<td class="summary">Create static grid basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_scroll">druid:new_scroll(...)</a></td>
<td class="summary">Create scroll basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_swipe">druid:new_swipe(...)</a></td>
<td class="summary">Create swipe basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_drag">druid:new_drag(...)</a></td>
<td class="summary">Create drag basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_dynamic_grid">druid:new_dynamic_grid(...)</a></td>
<td class="summary">Create dynamic grid component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_lang_text">druid:new_lang_text(...)</a></td>
<td class="summary">Create lang_text component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_slider">druid:new_slider(...)</a></td>
<td class="summary">Create slider component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_checkbox">druid:new_checkbox(...)</a></td>
<td class="summary">Create checkbox component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_input">druid:new_input(...)</a></td>
<td class="summary">Create input component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_checkbox_group">druid:new_checkbox_group(...)</a></td>
<td class="summary">Create checkbox_group component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_radio_group">druid:new_radio_group(...)</a></td>
<td class="summary">Create radio_group component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_timer">druid:new_timer(...)</a></td>
<td class="summary">Create timer component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_progress">druid:new_progress(...)</a></td>
<td class="summary">Create progress component</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "druid:initialize"></a>
<strong>druid:initialize(table, table)</strong>
</dt>
<dd>
Druid class constructor
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">table</span>
<span class="types"><span class="type">style</span></span>
Druid style module
</li>
<li><span class="parameter">table</span>
<span class="types"><span class="type">style</span></span>
Druid style module
</li>
</ul>
</dd>
<dt>
<a name = "druid:create"></a>
<strong>druid:create(component, ...)</strong>
</dt>
<dd>
Create new druid component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">component</span>
<span class="types"><span class="type">Component</span></span>
Component module
</li>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
Other component params to pass it to component:init function
</li>
</ul>
</dd>
<dt>
<a name = "druid:final"></a>
<strong>druid:final()</strong>
</dt>
<dd>
Call on final function on gui<em>script. It will call on</em>remove
on all druid components
</dd>
<dt>
<a name = "druid:remove"></a>
<strong>druid:remove(component)</strong>
</dt>
<dd>
Remove component from druid instance.
Component <code>on_remove</code> function will be invoked, if exist.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">component</span>
<span class="types"><span class="type">Component</span></span>
Component instance
</li>
</ul>
</dd>
<dt>
<a name = "druid:update"></a>
<strong>druid:update(dt)</strong>
</dt>
<dd>
Druid update function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">dt</span>
<span class="types"><span class="type">number</span></span>
Delta time
</li>
</ul>
</dd>
<dt>
<a name = "druid:on_input"></a>
<strong>druid:on_input(action_id, action)</strong>
</dt>
<dd>
Druid on_input function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">action_id</span>
<span class="types"><span class="type">hash</span></span>
Action<em>id from on</em>input
</li>
<li><span class="parameter">action</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Action from on_input
</li>
</ul>
</dd>
<dt>
<a name = "druid:on_message"></a>
<strong>druid:on_message(message_id, message, sender)</strong>
</dt>
<dd>
Druid on_message function
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">message_id</span>
<span class="types"><span class="type">hash</span></span>
Message<em>id from on</em>message
</li>
<li><span class="parameter">message</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Message from on_message
</li>
<li><span class="parameter">sender</span>
<span class="types"><span class="type">hash</span></span>
Sender from on_message
</li>
</ul>
</dd>
<dt>
<a name = "druid:on_focus_lost"></a>
<strong>druid:on_focus_lost()</strong>
</dt>
<dd>
Druid on focus lost interest function.
This one called by on<em>window</em>callback by global window listener
</dd>
<dt>
<a name = "druid:on_focus_gained"></a>
<strong>druid:on_focus_gained()</strong>
</dt>
<dd>
Druid on focus gained interest function.
This one called by on<em>window</em>callback by global window listener
</dd>
<dt>
<a name = "druid:on_layout_change"></a>
<strong>druid:on_layout_change()</strong>
</dt>
<dd>
Druid on layout change function.
Called on update gui layout
</dd>
<dt>
<a name = "druid.on_language_change"></a>
<strong>druid.on_language_change()</strong>
</dt>
<dd>
Druid on language change.
This one called by global gruid.on<em>language</em>change, but can be
call manualy to update all translations
</dd>
<dt>
<a name = "druid:new_button"></a>
<strong>druid:new_button(...)</strong>
</dt>
<dd>
Create button basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
button init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
button component
</ol>
</dd>
<dt>
<a name = "druid:new_blocker"></a>
<strong>druid:new_blocker(...)</strong>
</dt>
<dd>
Create blocker basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
blocker init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
blocker component
</ol>
</dd>
<dt>
<a name = "druid:new_back_handler"></a>
<strong>druid:new_back_handler(...)</strong>
</dt>
<dd>
Create back_handler basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
back_handler init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
back_handler component
</ol>
</dd>
<dt>
<a name = "druid:new_hover"></a>
<strong>druid:new_hover(...)</strong>
</dt>
<dd>
Create hover basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
hover init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
hover component
</ol>
</dd>
<dt>
<a name = "druid:new_text"></a>
<strong>druid:new_text(...)</strong>
</dt>
<dd>
Create text basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
text init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
text component
</ol>
</dd>
<dt>
<a name = "druid:new_grid"></a>
<strong>druid:new_grid(...)</strong>
</dt>
<dd>
Create grid basic component
Deprecated
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
grid init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
grid component
</ol>
</dd>
<dt>
<a name = "druid:new_static_grid"></a>
<strong>druid:new_static_grid(...)</strong>
</dt>
<dd>
Create static grid basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
grid init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
grid component
</ol>
</dd>
<dt>
<a name = "druid:new_scroll"></a>
<strong>druid:new_scroll(...)</strong>
</dt>
<dd>
Create scroll basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
scroll init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
scroll component
</ol>
</dd>
<dt>
<a name = "druid:new_swipe"></a>
<strong>druid:new_swipe(...)</strong>
</dt>
<dd>
Create swipe basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
swipe init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
swipe component
</ol>
</dd>
<dt>
<a name = "druid:new_drag"></a>
<strong>druid:new_drag(...)</strong>
</dt>
<dd>
Create drag basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
drag init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Componetn</span></span>
drag component
</ol>
</dd>
<dt>
<a name = "druid:new_dynamic_grid"></a>
<strong>druid:new_dynamic_grid(...)</strong>
</dt>
<dd>
Create dynamic grid component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
grid init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
grid component
</ol>
</dd>
<dt>
<a name = "druid:new_lang_text"></a>
<strong>druid:new_lang_text(...)</strong>
</dt>
<dd>
Create lang_text component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
lang_text init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
lang_text component
</ol>
</dd>
<dt>
<a name = "druid:new_slider"></a>
<strong>druid:new_slider(...)</strong>
</dt>
<dd>
Create slider component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
slider init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
slider component
</ol>
</dd>
<dt>
<a name = "druid:new_checkbox"></a>
<strong>druid:new_checkbox(...)</strong>
</dt>
<dd>
Create checkbox component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
checkbox init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
checkbox component
</ol>
</dd>
<dt>
<a name = "druid:new_input"></a>
<strong>druid:new_input(...)</strong>
</dt>
<dd>
Create input component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
input init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
input component
</ol>
</dd>
<dt>
<a name = "druid:new_checkbox_group"></a>
<strong>druid:new_checkbox_group(...)</strong>
</dt>
<dd>
Create checkbox_group component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
checkbox_group init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
checkbox_group component
</ol>
</dd>
<dt>
<a name = "druid:new_radio_group"></a>
<strong>druid:new_radio_group(...)</strong>
</dt>
<dd>
Create radio_group component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
radio_group init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
radio_group component
</ol>
</dd>
<dt>
<a name = "druid:new_timer"></a>
<strong>druid:new_timer(...)</strong>
</dt>
<dd>
Create timer component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
timer init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
timer component
</ol>
</dd>
<dt>
<a name = "druid:new_progress"></a>
<strong>druid:new_progress(...)</strong>
</dt>
<dd>
Create progress component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
progress init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Component</span></span>
progress component
</ol>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,513 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Button">Button </a></li>
<li><a href="#Text">Text </a></li>
<li><a href="#Blocker">Blocker </a></li>
<li><a href="#Back_Handler">Back Handler </a></li>
<li><a href="#Lang_text">Lang text </a></li>
<li><a href="#Scroll">Scroll </a></li>
<li><a href="#Progress">Progress </a></li>
<li><a href="#Slider">Slider </a></li>
<li><a href="#Input">Input </a></li>
<li><a href="#Checkbox">Checkbox </a></li>
<li><a href="#Checkbox_group">Checkbox group </a></li>
<li><a href="#Radio_group">Radio group </a></li>
<li><a href="#Timer">Timer </a></li>
<li><a href="#Static_Grid">Static Grid </a></li>
<li><a href="#Dynamic_Grid">Dynamic Grid </a></li>
<li><a href="#Hover">Hover </a></li>
<li><a href="#Swipe">Swipe </a></li>
<li><a href="#Drag">Drag </a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><strong>01-components</strong></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
</div>
<div id="content">
<h1>Druid components</h1>
<p><a name="Button"></a></p>
<h2>Button</h2>
<p><a href="https://insality.github.io/druid/modules/druid.button.html">Button API here</a></p>
<h3>Overview</h3>
<p>Basic Druid input component. Handle input on node and provide different callbacks on touch events.</p>
<h3>Setup</h3>
<p>Create button with druid: <code>button = druid:new_button(node_name, callback, [params], [animation_node])</code>
Where node name is name of node from GUI scene. You can use <code>node_name</code> as input trigger zone and point another node for animation via <code>animation_node</code></p>
<h3>Usecase</h3>
<p><em>fill example usecases</em></p>
<h3>Notes</h3>
<p>- Button callback have next params: (self, params, button_instance)</p>
<pre>
- **self** - Druid self context
- **params** - Additional params, specified on button creating
- **button_instance** - button itself
</pre>
<p>- You can set <em>params</em> on button callback on button creating: <code>druid:new_button(&quot;node_name&quot;, callback, params)</code>. This <em>params</em> will pass in callback as second argument
- Button have next events:</p>
<pre>
- **on_click** - basic button callback
- **on_repeated_click** - repeated click callback, <span class="keyword">while</span> holding the button, don<span class="string">'t trigger if callback is empty
- **on_long_click** - callback on long button tap, don'</span>t trigger <span class="keyword">if</span> callback is empty
- **on_hold_click** - hold callback, before long_click trigger, don<span class="string">'t trigger if callback is empty
- **on_double_click** - different callback, if tap button 2+ in row, don'</span>t trigger <span class="keyword">if</span> callback is empty
</pre>
<p>- Click event will not trigger, if between pressed and released state cursor was outside of node zone
- If button have double click event and it is triggered, usual callback will be not invoked
- If you have stencil on buttons and you don't want trigger them outside of stencil node, you can use <a href="../modules/druid.button.html#set_click_zone">button:set_click_zone</a> to restrict button click zone
- Button can have key trigger to use then by key: <a href="../modules/druid.button.html#set_key_trigger">button:set_key_trigger</a>
- Animation node can be used for example to animate small icon on big panel. Node name of trigger zone will be <code>big panel</code> and animation node will be <code>small icon</code></p>
<p><a name="Text"></a></p>
<h2>Text</h2>
<p><a href="https://insality.github.io/druid/modules/druid.text.html">Text API here</a></p>
<h3>Overview</h3>
<p>Basic Druid text component. Text components by default have the text size adjusting.</p>
<h3>Setup</h3>
<p>Create text node with druid: <code>text = druid:new_text(node_name, [initial_value], [is_disable_size_adjust])</code></p>
<h3>Notes</h3>
<p>- Text component by default have auto adjust text sizing. Text never will be bigger, than text node size, which you can setup in GUI scene. It can be disabled on component creating by settings argument <code>is_no_adjust</code> to <em>true</em></p>
<p><img src="../media/text_autosize.png" alt=""/></p>
<ul>
<li>Text pivot can be changed with <a href="../modules/druid.text.html#set_pivot">text:set_pivot</a>, and text will save their position inside their text size box:</li>
</ul>
<p><img src="../media/text_anchor.gif" alt=""/></p>
<p><a name="Blocker"></a></p>
<h2>Blocker</h2>
<p><a href="https://insality.github.io/druid/modules/druid.blocker.html">Blocker API here</a></p>
<h3>Overview</h3>
<p>Druid component for block input. Use it to block input in special zone.</p>
<h3>Setup</h3>
<p>Create blocker component with druid: <code>druid:new_blocker(node_name)</code></p>
<h3>Notes</h3>
<p>Explanation:
<img src="../media/blocker_scheme.png" alt=""/></p>
<p>Blue zone is <strong>button</strong> with close_window callback</p>
<p>Yellow zone is blocker with window content</p>
<p>So you can do the safe zones, when you have the big buttons</p>
<p><a name="Back_Handler"></a></p>
<h2>Back Handler</h2>
<p><a href="https://insality.github.io/druid/modules/druid.back_handler.html">Back handler API here</a></p>
<h3>Overview</h3>
<p>Component to handle back button. It handle Android back button and Backspace key. Key triggers in <code>input.binding</code> should be setup for correct working.</p>
<h3>Setup</h3>
<p>Setup callback with <code>druid:new_back_handler(callback)</code></p>
<h3>Notes</h3>
<p><a name="Lang_text"></a></p>
<h2>Lang text</h2>
<p><a href="https://insality.github.io/druid/modules/druid.lang_text.html">Lang text API here</a></p>
<h3>Overview</h3>
<p>Wrap on Text component to handle localization. It uses druid get<em>text</em>function to set text by it's id</p>
<h3>Setup</h3>
<p>Create lang text component with druid <code>text = druid:new_lang_text(node_name, locale_id)</code></p>
<h3>Notes</h3>
<p><a name="Scroll"></a></p>
<h2>Scroll</h2>
<p><a href="https://insality.github.io/druid/modules/druid.scroll.html">Scroll API here</a></p>
<h3>Overview</h3>
<p>Basic Druid scroll component. Handle all scrolling stuff in druid GUI</p>
<h3>Setup</h3>
<p>Create scroll component with druid: <code>scroll = druid:new_scroll(view_node, content_node)</code>.</p>
<p><em>View</em>node_ - is static part. It capturing user input and recognize scrolling touches</p>
<p><em>Content</em>node_ - is dynamic part. This node will change position by scroll system</p>
<p>Initial scroll size will be equal to <em>content</em>node_ node size. The initial view box will be equal to <em>view</em>node_ node size</p>
<p>Usually, Place <em>view</em>node_ and as children add <em>content</em>node_:
<img src="../media/scroll_scheme.png" alt=""/>
<img src="../media/scroll_outline.png" alt=""/></p>
<p>*Here content<em>node below view</em>node, in game content_node be able to scroll left until end*</p>
<h3>Notes</h3>
<p>- Scroll by default style have inertion and extra size for strecthing effect. It can be adjust via scroll <a href="https://insality.github.io/druid/modules/druid.scroll.html#Style">style settings</a>
- You can setup "points of interest". Scroll always will be centered on closes point of interest. It is able to create slider without inertion and points of interest on each scroll element.
- Scroll have next events:</p>
<pre>
- *on_scroll* (self, position) On scroll move callback
- *on_scroll_to* (self, position, is_instant) On scroll_to <span class="keyword">function</span> callback
- *on_point_scroll* (self, item_index, position) On scroll_to_index <span class="keyword">function</span> callback
</pre>
<p>- You can adjust scroll content size by <code>scroll:set_size(node_size)</code>. It will setup new size to <em>content node</em>
- You can enabled or disable inertion mode via <code>scroll:set_intert(state)</code>
- You can adjust extra stretch size via <a href="../modules/druid.scroll.html#set_extra_stretch_size">scroll:set_extra_stretch_size</a>
- Multitouch is required for scroll. Scroll is correctly handling touch_id swap while dragging scroll</p>
<p><a name="Progress"></a></p>
<h2>Progress</h2>
<p><a href="https://insality.github.io/druid/modules/druid.progress.html">Progress API here</a></p>
<h3>Overview</h3>
<p>Basic Druid progress bar component</p>
<h3>Setup</h3>
<p>Create progress bar component with druid: <code>progress = druid:new_progress(node_name, key, init_value)</code></p>
<p>Node name should have maximum node size, so in GUI scene, node_name should be fully filled.
Key is value from druid const: const.SIDE.X (or just "x") or const.SIDE.Y (or just "y")</p>
<h3>Notes</h3>
<p>- Progress correct working with 9slice nodes, it trying to set size by <em>set</em>size_ first, if it is not possible, it set up sizing via <em>set</em>scale_
- Progress bar can fill only by vertical or horizontal size. If you want make diagonal progress bar, just rotate node in GUI scene
- If you have glitchy or dark texture bug with progress bar, try to disable mipmaps in your texture profiles</p>
<p><a name="Slider"></a></p>
<h2>Slider</h2>
<p><a href="https://insality.github.io/druid/modules/druid.slider.html">Slider API here</a></p>
<h3>Overview</h3>
<p>Basic Druid slider component</p>
<h3>Setup</h3>
<p>Create slider component with druid: <code>slider = druid:new_slider(node_name, end_pos, callback)</code></p>
<p>Pin node (node_name in params) should be placed in zero position (initial). It will be available to mode Pin node between start pos and end pos. </p>
<h3>Notes</h3>
<p>- You can setup points of interests on slider via <a href="../modules/druid.slider.html#set_steps">slider:set_steps</a>. If steps are exist, slider values will be only from this steps (notched slider)
- For now, start pos and end pos should be on vertical or horizontal line (their x or y value should be equal)</p>
<p><a name="Input"></a></p>
<h2>Input</h2>
<p><a href="https://insality.github.io/druid/modules/druid.input.html">Input API here</a></p>
<h3>Overview</h3>
<p>Basic Druid text input component</p>
<h3>Setup</h3>
<p>Create input component with druid: <code>input = druid:new_input(button_node_name, text_node_name, keyboard_type)</code></p>
<h3>Notes</h3>
<p>- Input component handle user text input. Input contains from button and text components. Button needed for selecting/unselecting input field
- Long click on input field for clear and select input field (clearing can be disable via styles)
- Click outside of button to unselect input field
- On focus lost (game minimized) input field will be unselected
- You can setup max length of the text
- You can setup allowed characters. On add not allowed characters <code>on_input_wrong</code> will be called. By default it cause simple shake animation
- The keyboard for input will not show on mobile HTML5. So input field in mobile HTML5 is not working now
- To make work different keyboard type, make sure value in game.project Android:InputMethod set to HidderInputField (https://defold.com/manuals/project-settings/#input-method)</p>
<p><a name="Checkbox"></a></p>
<h2>Checkbox</h2>
<p><a href="https://insality.github.io/druid/modules/druid.checkbox.html">Checkbox API here</a></p>
<h3>Overview</h3>
<p>Basic Druid checkbox component.</p>
<h3>Setup</h3>
<p>Create checkbox component with druid: <code>checkbox = druid:new_checkbox(node, callback)</code></p>
<h3>Notes</h3>
<p>- Checkbox uses button to handle click
- You can setup another node to handle input with click_node arg in component init: <code>druid:new_checkbox(node, callback, [click_node])</code></p>
<p><a name="Checkbox_group"></a></p>
<h2>Checkbox group</h2>
<p><a href="https://insality.github.io/druid/modules/druid.checkbox_group.html">Checkbox group API here</a></p>
<h3>Overview</h3>
<p>Several checkboxes in one group</p>
<h3>Setup</h3>
<p>Create checkbox_group component with druid: <code>group = druid:new_checkbox_group(nodes[], callback)</code></p>
<h3>Notes</h3>
<p>- Callback arguments: <code>function(self, checkbox_index)</code>. Index is equals in <em>nodes[]</em> array in component constructor
- You can get/set checkbox_group state with <code>group:set_state()</code> and <code>group:get_state()</code></p>
<p><a name="Radio_group"></a></p>
<h2>Radio group</h2>
<p><a href="https://insality.github.io/druid/modules/druid.radio_group.html">Radio group API here</a></p>
<h3>Overview</h3>
<p>Several checkboxes in one group with single choice</p>
<h3>Setup</h3>
<p>Create radio_group component with druid: <code>group = druid:new_radio_group(nodes[], callback)</code></p>
<h3>Notes</h3>
<p>- Callback arguments: <code>function(self, checkbox_index)</code>. Index is equals in <em>nodes[]</em> array in component constructor
- You can get/set radio_group state with <code>group:set_state()</code> and <code>group:get_state()</code>
- Only different from checkbox_group: on click another checkboxes in this group will be unchecked</p>
<p><a name="Timer"></a></p>
<h2>Timer</h2>
<p><a href="https://insality.github.io/druid/modules/druid.timer.html">Timer API here</a></p>
<h3>Overview</h3>
<p>Handle timer work on gui text node</p>
<h3>Setup</h3>
<p>Create timer component with druid: <code>timer = druid:new_timer(text_node, from_seconds, to_seconds, callback)</code></p>
<h3>Notes</h3>
<p>- Timer fires callback, when timer value equals to <em>to</em>seconds_
- Timer will setup text node with current timer value
- Timer uses update function to handle time</p>
<p><a name="Static_Grid"></a></p>
<h2>Static Grid</h2>
<p><a href="https://insality.github.io/druid/modules/druid.static_grid.html">Static Grid API here</a></p>
<h3>Overview</h3>
<p>Component for manage node positions.
Static grid have constant node size, so it possible to calculate node positions before placement. Nodes can be placed with gaps.
Static grid can shift elements on add/remove functions.</p>
<h3>Setup</h3>
<p>Create component with druid: <code>grid = druid:new_static_grid(parent_node, prefab_node, max_in_row_elements)</code></p>
<h3>Notes</h3>
<p>- On <em>add node</em> grid will set node parent to <em>parent</em>node_
- You can get array of position of every element for setup points of interest in scroll component
- You can get size of all elements for setup size in scroll component
- You can also bind the grid to the scroll component for auto resize scroll content size
- Pivot of parent_node matter for node placement
- <em>Prefab node</em> used to get node size and anchor
- You can point *position_function* for animations with <em>static</em>grid:set<em>position</em>function(node, pos)_ callback. Default - *gui.set_position()*</p>
<p><a name="Dynamic_Grid"></a></p>
<h2>Dynamic Grid</h2>
<p><a href="https://insality.github.io/druid/modules/druid.dynamic_grid.html">Dynamic Grid API here</a></p>
<h3>Overview</h3>
<p>Component for manage node positions with different node sizes.
Unlike Static Grid, Dynamic Grid can place nodes only in one row or in one column.
Dynamic Grid can't have gaps between elements - you will get error, if try spawn element far away from others.
Dynamic Grid should have <strong>West</strong>, <strong>East</strong>, <strong>South</strong> or <strong>North</strong> pivot (vertical or horizontal element placement)</p>
<h3>Setup</h3>
<p>Create component with druid: <code>grid = druid:new_dynamic_grid(parent_node)</code></p>
<p>Check the <em>parent</em>node_ have correct pivot point. You will get the error otherwise.</p>
<h3>Notes</h3>
<p>- On <em>add node</em> grid will set node parent to <em>parent</em>node_
- You can get array of position of every element for setup points of interest in scroll component
- You can get size of all elements for setup size in scroll component
- You can also bind the grid to the scroll component for auto resize scroll content size
- Pivot of parent<em>node matter for node placement
- You can point *position</em>function* for animations with <em>static</em>grid:set<em>position</em>function(node, pos)_ callback. Default - *gui.set_position()*
- First node placed at Grid pivot point. Other nodes placed nearby of other nodes.
- On <em>add/remove</em> nodes always shifted. You can point the shift side in this functions (*is<em>shift</em>left* boolean argument)</p>
<p><a name="Hover"></a></p>
<h2>Hover</h2>
<p><a href="https://insality.github.io/druid/modules/druid.hover.html">Hover API here</a></p>
<h3>Overview</h3>
<p>System Druid component, handle hover node state.</p>
<h3>Setup</h3>
<p>Create hover component with druid: <code>hover = druid:new_hover(node, callback)</code></p>
<h3>Notes</h3>
<p>- By default, hover handles <em>hover event</em> with pressed touch action_id. So it's mean, what mouse or touch have to be pressed
- On desktop platforms there is <em>on</em>mouse<em>hover</em> event. It's event on mouse hover without any action id
- By default, assume what node is on not hovered state (both <em>hover</em> and <em>mouse</em>hover_)</p>
<p><a name="Swipe"></a></p>
<h2>Swipe</h2>
<p><a href="https://insality.github.io/druid/modules/druid.swipe.html">Swipe API here</a></p>
<h3>Overview</h3>
<p>System Druid component, handle swipe actions on node</p>
<h3>Setup</h3>
<p>Create swipe component with druid: <code>hover = druid:new_swipe(node, swipe_callback)</code></p>
<h3>Notes</h3>
<p>- Swipe callback have next params: (self, swipe_side, distance, time)</p>
<pre>
- **self** - Druid self context
- **swipe_side**: *<span class="global">string</span>* - values from [<span class="string">"up"</span>, <span class="string">"down"</span>, <span class="string">"left"</span>, <span class="string">"right"</span>]
- **distance**: *number* - <span class="keyword">in</span> pixels, distance of swipe
- **time**: *number* - <span class="keyword">in</span> seconds, time of swiping
</pre>
<p>- Swipe trigger only, if all input actions was on swipe node. If action will be outside of node, swipe status will be reseted
- In swipe style table you can adjust minimal distance and maximum time to trigg- Hover state trigger only with touch on mobile devices or button mouse holding. Just mouse over swipe
- In swipe style table you can toggle type of swipe triggering. if SWIPE<em>TRIGGER</em>ON_MOVE setup to true - swipe will trigger as swipe can be triggered. If setup to false - swipe will trigger only on released action
- If you have stencil on swipe node and you don't want trigger it outside of stencil node, you can use <a href="../modules/druid.swipe.html#set_click_zone">swipe:set_click_zone</a> to restrict swipe zonethout buttons is now not allowed.</p>
<p><a name="Drag"></a></p>
<h2>Drag</h2>
<p><a href="https://insality.github.io/druid/modules/druid.drag.html">Drag API here</a></p>
<h3>Overview</h3>
<p>System Druid component, handle drag actions on node</p>
<h3>Setup</h3>
<p>Create drag component with druid: <code>hover = druid:new_drag(node, drag_callback)</code></p>
<h3>Notes</h3>
<p>- Drag callback have next params: (self, swipe_side, distance, time)</p>
<pre>
- **self**: Druid self context
- **dx**: *number* - delta x position
- **dy**: *number* - delta y position
</pre>
<p>- In styles, you can point the drag start deadzone. Default value is 10 pixels
- Drag correctly process multitouch. You can switch touch_id, while dragging on node with correct <em>dx</em> and <em>dy</em> values (made for correct scrolling)
- You can restrict horizontal or vertical dragging by setting <code>drag.can_x</code> or <code>drag.can_y</code> to <em>false</em> value
- You can get info about current drag state:</p>
<pre>
- _is_touch_ - Is currently node touching
- _is_drag_ - Is currently node is dragging
- _x_ <span class="keyword">and</span> _y_ - Current touch position
- _touch_start_pos_ - Touch stat positions
</pre>
<p>- Drag have next events:</p>
<pre>
- _on_touch_start_ (self) - Event on touch start
- _on_touch_end_ (self) - Event on touch <span class="keyword">end</span>
- _on_drag_start_ (self) - Event on drag start
- _on_drag_ (self, dx, dy) - Event on drag process
- _on_drag_end_ (self) - Event on drag <span class="keyword">end</span>
</pre>
<p>- Drag node zone can be restricted via <code>drag:set_click_zone(node)</code></p>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,254 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Overview">Overview </a></li>
<li><a href="#Custom_components">Custom components </a></li>
<li><a href="#Best_practice_on_custom_components">Best practice on custom components </a></li>
<li><a href="#Power_of_using_templates">Power of using templates </a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><strong>Creating custom components</strong></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
</div>
<div id="content">
<h1>Creating custom components</h1>
<p><a name="Overview"></a></p>
<h2>Overview</h2>
<p>Druid allows you to create your custom components from druid basic components or other custom components.</p>
<p>Every component is the children of Basic Druid component. Read the [basic component API here].(https://insality.github.io/druid/modules/component.html), Methods of basic components you can call via self:{method_name}</p>
<p><a name="Custom_components"></a></p>
<h2>Custom components</h2>
<p>Basic custom component template looks like this:</p>
<pre>
<span class="keyword">local</span> const = <span class="global">require</span>(<span class="string">"druid.const"</span>)
<span class="keyword">local</span> component = <span class="global">require</span>(<span class="string">"druid.component"</span>)
<span class="keyword">local</span> M = component.create(<span class="string">"my_component"</span>)
<span class="comment">-- Component constructor
</span><span class="keyword">function</span> M.init(self, ...)
<span class="keyword">end</span>
<span class="comment">-- Call only if exist interest: const.ON_UPDATE
</span><span class="keyword">function</span> M.update(self, dt)
<span class="keyword">end</span>
<span class="comment">-- Call only if exist interest: const.ON_INPUT or const.ON_INPUT_HIGH
</span><span class="keyword">function</span> M.on_input(self, action_id, action)
<span class="keyword">end</span>
<span class="comment">-- Call on component creation and on component:set_style() function
</span><span class="keyword">function</span> M.on_style_change(self, style)
<span class="keyword">end</span>
<span class="comment">-- Call only if exist interest: const.ON_MESSAGE
</span><span class="keyword">function</span> M.on_message(self, message_id, message, sender)
<span class="keyword">end</span>
<span class="comment">-- Call only if component with ON_ANGUAGECHANinterest
</span><span class="keyword">function</span> M.on_anguagechanself)
<span class="keyword">end</span>
<span class="comment">-- Call only if component with ON_LAYOUT_CHANGE interest
</span><span class="keyword">function</span> M.on_layout_change(self)
<span class="keyword">end</span>
<span class="comment">-- Call, if input was capturing before this component
</span><span class="comment">-- Example: scroll is start scrolling, so you need unhover button
</span><span class="keyword">function</span> M.on_input_interrupt(self)
<span class="keyword">end</span>
<span class="comment">-- Call, if game lost focus. Need ON_FOCUS_LOST intereset
</span><span class="keyword">function</span> M.on_focus_lost(self)
<span class="keyword">end</span>
<span class="comment">-- Call, if game gained focus. Need ON_FOCUS_GAINED intereset
</span><span class="keyword">function</span> M.on_focus_gained(self)
<span class="keyword">end</span>
<span class="comment">-- Call on component remove or on druid:final
</span><span class="keyword">function</span> M.on_remove(self)
<span class="keyword">end</span>
<span class="keyword">return</span> M
</pre>
<p>Add your custom component to druid via <a href="../modules/druid.html#register">druid.register</a></p>
<pre>
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="keyword">local</span> my_component = <span class="global">require</span>(<span class="string">"my.amazing.component"</span>)
<span class="keyword">function</span> init(self)
druid.register(<span class="string">"my_component"</span>, my_component)
<span class="keyword">end</span>
</pre>
<p>Registering make new function with "new<em>{component</em>name}". In our example it will be: <code>druid:new_my_component()</code>.</p>
<p>Or you can create component without registering with <code>druid:create(my_component_module)</code></p>
<p>As component registered, you can create your component with next code:</p>
<pre>
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="keyword">local</span> my_component = <span class="global">require</span>(<span class="string">"my.amazing.component"</span>)
<span class="keyword">function</span> init(self)
self.druid = druid.new(self)
<span class="keyword">local</span> my_component = self.druid:new_my_component(...)
<span class="comment">-- or --
</span> <span class="keyword">local</span> my_component = self.druid:create(my_component, ...)
<span class="keyword">end</span>
</pre>
<h3>Interest</h3>
<p>Interest - is a way to indicate what events your component will respond to.
There is next interests in druid:
- <strong>ON_MESSAGE</strong> - component will receive messages from on_message</p>
<ul>
<li><p><strong>ON_UPDATE</strong> - component will be updated from update</p></li>
<li><p><strong>ON<em>INPUT</em>HIGH</strong> - component will receive input from on<em>input, before other components with ON</em>INPUT</p></li>
<li><p><strong>ON_INPUT</strong> - component will receive input from on<em>input, after other components with ON</em>INPUT_HIGH</p></li>
<li><p><strong>ON<em>LANGUAGE</em>CHANGE</strong> - will call <em>on</em>language<em>change</em> function on language change trigger</p></li>
<li><p><strong>ON<em>LAYOUT</em>CHANGE</strong> will call <em>on</em>layout<em>change</em> function on layout change trigger</p></li>
<li><p><strong>ON<em>FOCUS</em>LOST</strong> will call <em>on</em>focust<em>lost</em> function in on focus lost event. You need to pass window_callback to global <a href="../modules/druid.html#on_window_callback">druid:on_window_callback</a></p></li>
<li><p><strong>ON<em>FOCUS</em>GAINED</strong> will call <em>on</em>focust<em>gained</em> function in on focus gained event. You need to pass window_callback to global <a href="../modules/druid.html#on_window_callback">druid:on_window_callback</a></p></li>
</ul>
<p><a name="Best_practice_on_custom_components"></a></p>
<h2>Best practice on custom components</h2>
<p>On each component recommended describe component scheme in next way:</p>
<pre>
<span class="comment">-- Component module
</span><span class="keyword">local</span> component = <span class="global">require</span>(<span class="string">"druid.component"</span>)
<span class="keyword">local</span> M = component.create(<span class="string">"your_component"</span>)
<span class="keyword">local</span> SCHEME = {
ROOT = <span class="string">"root"</span>,
ITEM = <span class="string">"item"</span>,
TITLE = <span class="string">"title"</span>
}
<span class="keyword">function</span> M.init(self, template_name, node_table)
<span class="comment">-- If component use template, setup it:
</span> self:set_template(template_name)
<span class="comment">-- If component was cloned with gui.clone_tree, pass his nodes
</span> self:set_nodes(node_table)
<span class="comment">-- helper can get node from gui/template/table
</span> <span class="keyword">local</span> root = self:get_node(SCHEME.ROOT)
<span class="comment">-- This component can spawn another druid components:
</span> <span class="keyword">local</span> druid = self:get_druid()
<span class="comment">-- Button self on callback is self of _this_ component
</span> <span class="keyword">local</span> button = druid:new_button(...)
<span class="keyword">end</span>
</pre>
<p><a name="Power_of_using_templates"></a></p>
<h2>Power of using templates</h2>
<p>You can use one component, but creating and customizing templates for them. Templates only requires to match the component scheme.</p>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,164 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Overview">Overview </a></li>
<li><a href="#Usage">Usage </a></li>
<li><a href="#Create_your_own_styles">Create your own styles </a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><strong>Styles</strong></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
</div>
<div id="content">
<h1>Styles</h1>
<p><a name="Overview"></a></p>
<h2>Overview</h2>
<p>Styles - set of functions and parameters for components to customize their behavior.</p>
<p>Styles is a table, where key is name of component, and value is style table for this component.</p>
<p>In component API documentation, you can find the style API for this component. Or just lookup for existing styles and modify them.</p>
<p><a name="Usage"></a></p>
<h2>Usage</h2>
<p>Setup default druid style for all druid instances via <a href="../modules/druid.html#set_default_style">druid.set_default_style</a>
You can pass <em>nil</em> or <em>empty</em>table_ to use default values for all components (no styles)</p>
<pre>
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="keyword">local</span> my_style = <span class="global">require</span>(<span class="string">"my.amazing.style"</span>)
<span class="keyword">local</span> <span class="keyword">function</span> init(self)
druid.set_default_style(my_style)
<span class="keyword">end</span>
</pre>
<p>Setup custom style to specific druid instance:</p>
<pre>
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="keyword">local</span> my_style = <span class="global">require</span>(<span class="string">"my.amazing.style"</span>)
<span class="keyword">local</span> <span class="keyword">function</span> init(self)
<span class="comment">-- This druid instance will be use my_style as default
</span> self.druid = druid.new(self, my_style)
<span class="keyword">end</span>
</pre>
<p>Change component style with <em>set</em>style_ function</p>
<pre>
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="keyword">local</span> my_style = <span class="global">require</span>(<span class="string">"my.amazing.style"</span>)
<span class="keyword">local</span> <span class="keyword">function</span> init(self)
self.druid = druid.new(self)
self.button = self.druid:new_button(self, <span class="string">"node"</span>)
<span class="comment">-- Setup custom style for specific component
</span> self.button:set_style(my_style)
<span class="keyword">end</span>
</pre>
<p><a name="Create_your_own_styles"></a></p>
<h2>Create your own styles</h2>
<p>The most components have their styles. You can explore it on <a href="https://insality.github.io/druid/">Druid API</a> in table style section (<a href="https://insality.github.io/druid/modules/druid.button.html#Style">button example</a>). Or you can see, what fields component uses in code in function <code>on_style_change</code></p>
<p>To create you style, create lua module, what return &lt;<em>component</em>name_, <em>component</em>style_> table</p>
<p>Example: <a href="https://github.com/Insality/druid/blob/develop/druid/styles/default/style.lua">default druid style</a></p>
<p>Override all fields you want and set your style with one of next ways:</p>
<ul>
<li>Set your style as global via <a href="../modules/druid.html#set_default_style">druid.set_default_style</a></li>
<li>Set style for concrete druid instance via <code>druid = druid.new(self, style)</code></li>
<li>Set style for concrete instance via <code>component:set_style(style)</code></li>
</ul>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,101 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Overview">Overview </a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><strong>Druid assets</strong></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
</div>
<div id="content">
<h1>Druid assets</h1>
<p><a name="Overview"></a></p>
<h2>Overview</h2>
<p>I've created <a href="https://github.com/Insality/druid-assets">druid-assets repository</a> to make a <em>marketplace</em> with custom styles and components.</p>
<p>Any of Druid users can push their own components and styles to share it with the other users</p>
<p>Also, this marketplace is great example to how you can create your custom components</p>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,99 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Overview">Overview </a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><strong>Examples</strong></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
</div>
<div id="content">
<h1>Examples</h1>
<p><a name="Overview"></a></p>
<h2>Overview</h2>
<p>See the <a href="https://github.com/Insality/druid/tree/develop/example/kenney">example folder</a> for examples of how to use Druid</p>
<p>Try the <a href="https://insality.github.io/druid/druid/">HTML5 version</a> of the example app</p>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,358 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Setup">Setup </a></li>
<li><a href="#Components">Components </a></li>
<li><a href="#Basic_usage">Basic usage </a></li>
<li><a href="#Druid_Events">Druid Events </a></li>
<li><a href="#Druid_Lifecycle">Druid Lifecycle </a></li>
<li><a href="#Details">Details </a></li>
<li><a href="#Examples">Examples </a></li>
<li><a href="#Documentation">Documentation </a></li>
<li><a href="#Games_powered_by_Druid">Games powered by Druid </a></li>
<li><a href="#License">License </a></li>
<li><a href="#Issues_and_suggestions">Issues and suggestions </a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><strong>README</strong></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
</div>
<div id="content">
<a href="https://insality.github.io/druid/"><img src="media/druid_logo.png" alt=""/></a></p>
<p><a href="https://github.com/Insality/druid/releases"><img src="https://img.shields.io/github/v/release/insality/druid" alt="GitHub release (latest by date)"/></a></p>
<p><strong>Druid</strong> - powerful Defold component UI library. Use basic and extended <strong>Druid</strong> components or make your own game-specific components to make amazing GUI in your games.</p>
<p><a name="Setup"></a></p>
<h2>Setup</h2>
<h3>Dependency</h3>
<p>You can use the <strong>Druid</strong> extension in your own project by adding this project as a <a href="https://www.defold.com/manuals/libraries/">Defold library dependency</a>. Open your game.project file and in the dependencies field under project add:</p>
<blockquote>
<p><a href="https://github.com/Insality/druid/archive/master.zip">https://github.com/Insality/druid/archive/master.zip</a></p>
</blockquote>
<p>Or point to the ZIP file of a <a href="https://github.com/Insality/druid/releases">specific release</a>.</p>
<h3>Input bindings</h3>
<p>For <strong>Druid</strong> to work requires next input bindings:</p>
<ul>
<li>Mouse trigger - <code>Button 1</code> -> <code>touch</code> <em>For basic input components</em></li>
<li>Key trigger - <code>Backspace</code> -> <code>key_backspace</code> <em>For back</em>handler component, input component_</li>
<li>Key trigger - <code>Back</code> -> <code>key_back</code> <em>For back</em>handler component, Android back button, input component_</li>
<li>Key trigger - <code>Enter</code> -> <code>key_enter</code> <em>For input component, optional</em></li>
<li>Key trigger - <code>Esc</code> -> <code>key_esc</code> <em>For input component, optional</em></li>
<li>Touch triggers - <code>Touch multi</code> -> <code>multitouch</code> <em>For scroll component</em></li>
</ul>
<p><img src="media/input_binding_2.png" alt=""/>
<img src="media/input_binding_1.png" alt=""/></p>
<h3>Input capturing [optional]</h3>
<p>By default, <strong>Druid</strong> will auto-capture input focus, if any input component will be created. So you don't need to call <code>msg.post(&quot;.&quot;, &quot;acquire_input_focus&quot;)</code></p>
<p>If you not need this behaviour, you can disable it by settings <code>druid.no_auto_input</code> field in <em>game.project</em>:</p>
<pre><code> [druid]
no_auto_input = 1
</code></pre>
<h3>Code [optional]</h3>
<p>Adjust <strong>Druid</strong> settings, if needed:</p>
<pre>
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="comment">-- Used for button component and custom components
</span><span class="comment">-- Callback should play sound by name
</span>druid.set_sound_function(callback)
<span class="comment">-- Used for lang_text component
</span><span class="comment">-- Callback should return localized string by locale id
</span>druid.set_text_function(callback)
<span class="comment">-- Used for change default druid style
</span>druid.set_default_style(your_style)
<span class="comment">-- Call this function on language changing in the game,
</span><span class="comment">-- to retranslate all lang_text components:
</span>druid.on_language_change()
<span class="comment">-- Call this function inside window.set_listener
</span><span class="comment">-- to catch game focus lost/gained callbacks:
</span>druid.on_window_callback(event)
</pre>
<p><a name="Components"></a></p>
<h2>Components</h2>
<p><strong>Druid</strong> provides next <em>basic</em> components:</p>
<ul>
<li><p><strong><a href="master/docs_md/01-components.md#button">Button</a></strong> - Basic Druid button input component. Handles all types of interaction (tap, long-tap, hold-tap, double-tap, simple key triggers, etc)</p></li>
<li><p><strong><a href="master/docs_md/01-components.md#text">Text</a></strong> - Basic Druid text component. Wrap on gui text node, handle text size adjusting.</p></li>
<li><p><strong><a href="master/docs_md/01-components.md#scroll">Scroll</a></strong> - Basic Druid scroll component</p></li>
<li><p><strong><a href="master/docs_md/01-components.md#blocker">Blocker</a></strong> - Block input in node zone component</p></li>
<li><p><strong><a href="master/docs_md/01-components.md#back-handler">Back Handler</a></strong> - Handle back button (Android back button, backspace key)</p></li>
<li><p><strong><a href="master/docs_md/01-components.md#static-grid">Static Grid</a></strong> - Component for manage node positions with equal sizes</p></li>
<li><p><strong><a href="master/docs_md/01-components.md#hover">Hover</a></strong> - System Druid component, handle hover node state</p></li>
<li><p><strong><a href="master/docs_md/01-components.md#swipe">Swipe</a></strong> - System Druid component, handle swipe gestures on node</p></li>
<li><p><strong><a href="master/docs_md/01-components.md#drag">Drag</a></strong> - System Druid component, handle drag input on node </p></li>
</ul>
<p><strong>Druid</strong> also provides next <em>extended</em> components:</p>
<p><strong>*Note</strong>: In future, to use extended components, you should register them first. It's required for make <strong>Druid</strong> modular - to exclude unused components from build*</p>
<ul>
<li><p><strong><a href="master/docs_md/01-components.md#checkbox">Checkbox</a></strong> - Checkbox component</p></li>
<li><p><strong><a href="master/docs_md/01-components.md#checkbox-group">Checkbox group</a></strong> - Several checkboxes in one group</p></li>
<li><p><strong><a href="master/docs_md/01-components.md#dynamic-grid">Dynamic Grid</a></strong> - Component for manage node positions with different sizes. Only in one row or column</p></li>
<li><p><strong><a href="master/docs_md/01-components.md#input">Input</a></strong> - User text input component</p></li>
<li><p><strong><a href="master/docs_md/01-components.md#lang-text">Lang text</a></strong> - Wrap on Text component to handle localization</p></li>
<li><p><strong><a href="master/docs_md/01-components.md#progress">Progress</a></strong> - Progress bar component</p></li>
<li><p><strong><a href="master/docs_md/01-components.md#radio-group">Radio group</a></strong> - Several checkboxes in one group with single choice</p></li>
<li><p><strong><a href="master/docs_md/01-components.md#slider">Slider</a></strong> - Slider component</p></li>
<li><p><strong><a href="master/docs_md/01-components.md#timer">Timer</a></strong> - Handle timer work on gui text node</p></li>
</ul>
<p>Full info see on <em><a href="master/docs_md/01-components.md">components.md</a></em></p>
<p><a name="Basic_usage"></a></p>
<h2>Basic usage</h2>
<p>For using <strong>Druid</strong>, first you should create Druid instance to spawn components. Pass to new Druid instance main engine functions: <em>update</em>, *on<em>message* and *on</em>input*</p>
<p>All <strong>Druid</strong> components as arguments can apply node name string, you can don't do <code>gui.get_node()</code> before</p>
<p>All <strong>Druid</strong> and component methods calling with <code>:</code> like <code>self.druid:new_button()</code></p>
<pre>
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="keyword">local</span> <span class="keyword">function</span> button_callback(self)
<span class="global">print</span>(<span class="string">"Button was clicked!"</span>)
<span class="keyword">end</span>
<span class="keyword">function</span> init(self)
self.druid = druid.new(self)
self.druid:new_button(<span class="string">"button_node_name"</span>, button_callback)
<span class="keyword">end</span>
<span class="keyword">function</span> final(self)
self.druid:final()
<span class="keyword">end</span>
<span class="keyword">function</span> on_input(self, action_id, action)
<span class="keyword">return</span> self.druid:on_input(action_id, action)
<span class="keyword">end</span>
</pre>
<p>Learn <strong>Druid</strong> instance <a href="https://insality.github.io/druid/modules/druid_instance.html">functions here</a>)</p>
<p><a name="Druid_Events"></a></p>
<h2>Druid Events</h2>
<p>Any <strong>Druid</strong> components as callbacks uses <a href="https://insality.github.io/druid/modules/druid_event.html">Druid Events</a>. In component API (<a href="https://insality.github.io/druid/modules/druid.button.html#Events">button example</a>) pointed list of component events. You can manually subscribe on this events by next API:</p>
<ul>
<li><p><strong>event:subscribe</strong>(callback)</p></li>
<li><p><strong>event:unsubscribe</strong>(callback)</p></li>
<li><p><strong>event:clear</strong>()</p></li>
</ul>
<p>You can subscribe several callbacks on single event.</p>
<p><a name="Druid_Lifecycle"></a></p>
<h2>Druid Lifecycle</h2>
<p>Here is full Druid lifecycle setup in your <strong>*.gui_script</strong> file:</p>
<pre>
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="keyword">function</span> init(self)
self.druid = druid.new(self)
<span class="keyword">end</span>
<span class="keyword">function</span> final(self)
self.druid:final()
<span class="keyword">end</span>
<span class="keyword">function</span> update(self, dt)
self.druid:update(dt)
<span class="keyword">end</span>
<span class="keyword">function</span> on_input(self, action_id, action)
<span class="keyword">return</span> self.druid:on_input(action_id, action)
<span class="keyword">end</span>
<span class="keyword">function</span> on_message(self, message_id, message, sender)
self.druid:on_message(message_id, message, sender)
<span class="keyword">end</span>
</pre>
<ul>
<li><em>final</em> <strong>required</strong> function for correct Druid lifecycle</li>
<li>*on_input* used for almost all Druid components</li>
<li><em>update</em> used for progress bar, scroll and timer base components</li>
<li>*on_message* used for specific Druid events, like language change or layout change</li>
</ul>
<p>Recommended is fully integrate all <strong>Druid</strong> lifecycles functions</p>
<p><a name="Details"></a></p>
<h2>Details</h2>
<ul>
<li>Druid input goes as stack. Last created button will checked first. So create your GUI from back</li>
<li>Don't forget about <code>return</code> in <code>on_input</code>: <code>return self.druid:on_input()</code>. It need, if you have more than 1 acquire inputs (several Druid, other input system, etc)</li>
<li>Druid by default do <em>acquire</em>input<em>focus</em>. So you don't need do it manually. Buy only if you have components, which requires <em>on</em>input_ </li>
<li>If you want to delete node with declared Druid component, don't forget to remove them via <code>druid:remove(component)</code></li>
</ul>
<p>See full <a href="master/docs_md/FAQ.md">See FAQ here</a></p>
<p><a name="Examples"></a></p>
<h2>Examples</h2>
<p>See the <a href="https://github.com/Insality/druid/tree/develop/example">example folder</a> for examples of how to use <strong>Druid</strong></p>
<p>See the <a href="https://github.com/insality/druid-assets">druid-assets repository</a> for examples of how to create custom components and styles</p>
<p>Try the <a href="https://insality.github.io/druid/druid/">HTML5 version</a> of the example app</p>
<p><a name="Documentation"></a></p>
<h2>Documentation</h2>
<p>To learn <strong>Druid</strong> better, read next documentation:
- <a href="master/docs_md/01-components.md">Druid components</a>
- <a href="master/docs_md/02-creating_custom_components.md">Create custom components</a>
- <a href="master/docs_md/FAQ.md">See FAQ article</a>
- <a href="master/docs_md/03-styles.md">Druid styles</a>
- <a href="master/docs_md/04-druid_assets.md">Druid asset store</a></p>
<p>Full <strong>Druid</strong> documentation you can find here:
https://insality.github.io/druid/</p>
<p><a name="Games_powered_by_Druid"></a></p>
<h2>Games powered by Druid</h2>
<p><em>You published your game and you using Druid? Note me!</em></p>
<p><a name="License"></a></p>
<h2>License</h2>
<ul>
<li>Developed and supporting by <a href="https://github.com/Insality">Insality</a></li>
<li>Original idea by <a href="https://github.com/AGulev">AGulev</a></li>
<li>Assets from <a href="http://www.kenney.nl/">Kenney</a></li>
</ul>
<p><strong>MIT</strong> License</p>
<p><a name="Issues_and_suggestions"></a></p>
<h2>Issues and suggestions</h2>
<p>If you have any issues, questions or suggestions please <a href="https://github.com/Insality/druid/issues">create an issue</a> or contact me: <a href="mailto:insality@gmail.com">insality@gmail.com</a>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,252 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><strong>Druid 0.3.0:</strong></li>
<li><a href="../topics/faq.md.html">faq</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
</div>
<div id="content">
<h3>Druid 0.3.0:</h3>
<ul>
<li><p><code>Druid:final()</code> now is important function for correct working</p></li>
<li><p>Add <em>swipe</em> basic component</p>
<pre>
- Swipe component handle simple swipe gestures on node. It has single callback with direction on swipe. You can adjust a several parameters of swipe <span class="keyword">in</span> druid style.
- Swipe can be triggered on action.released <span class="keyword">or</span> <span class="keyword">while</span> user is make swiping (<span class="keyword">in</span> process)
- Add swipe example at main Druid example. Try swipe left/right to switch example pages.
</pre>
</li>
<li><p>Add <em>input</em> basic component</p>
<pre>
- Input component handle user text input. Input contains from button <span class="keyword">and</span> text components. Button needed <span class="keyword">for</span> selecting/unselecting input field
- Long click on input field <span class="keyword">for</span> clear <span class="keyword">and</span> <span class="global">select</span> input field (clearing can be disable via styles)
- Click outside of button to unselect input field
- On focus lost (game minimized) input field will be unselected
- You can setup max length of the text
- You can setup allowed characters. On add <span class="keyword">not</span> allowed characters <span class="backtick"><code>on_input_wrong</code></span> will be called. By default it cause simple shake animation
- The keyboard <span class="keyword">for</span> input will <span class="keyword">not</span> show on mobile HTML5. So input field <span class="keyword">in</span> mobile HTML5 is <span class="keyword">not</span> working now
- To make work different keyboard <span class="global">type</span>, make sure value <span class="keyword">in</span> game.project Android:InputMethod set to HiddenInputField (https://defold.com/manuals/project-settings/#input-method)
</pre>
</li>
<li><p>Add two functions to basic component: <code>increase_input_priority</code> and <code>reset_input_priority</code>. It used to process component input first in current input stack (there is two input stacks now: INPUT and INPUT_HIGH). Example: on selecting input field, it increase input self priority until it be unselected</p></li>
<li><p>Add two new component interests: <code>on_focus_gain</code> and <code>on_focus_lost</code></p></li>
<li><p>Add global druid events:</p>
<pre>
- on_window_callback: call <span class="backtick"><code>druid.on_window_callback(event)</code></span> <span class="keyword">for</span> on_focus_gain/lost correct work
- on_language_change: call <span class="backtick"><code>druid.on_language_change()</code></span> (#<span class="number">38</span>) <span class="keyword">for</span> update all druid instances lang components
- on_layout_change: call <span class="backtick"><code>druid.on_layout_change()</code></span> (#<span class="number">37</span>) <span class="keyword">for</span> update all gui layouts (unimplemented now)
</pre>
</li>
<li><p>Add button <code>on_click_outside</code> event. You can subscribe on this event in button. Was needed for Input component (click outside to deselect input field)</p></li>
<li><p>Add <em>start</em>pos_ field to button component</p></li>
<li><p>Changed input binding settings. Add esc, enter, text and marked_text. Backspace now is different from android back button event. Check the README setup section</p></li>
<li><p>Renamed <em>on</em>change<em>language</em> -> <em>on</em>language<em>change</em> component interest</p></li>
<li><p>Add several examples to druid-assets respository (see live example here): https://insality.github.io/druid-assets/)</p></li>
<li><p>Known issues:</p>
<pre>
- Adjusting text size by height works wrong. Adjusting single line texting works fine
- Space is <span class="keyword">not</span> working <span class="keyword">in</span> HTML5
</pre>
<h3>Druid 0.4.0:</h3></li>
<li><p>Add <em>Drag</em> basic component</p>
<pre>
- Drag component allow you detect dragging on GUI node
- Drag will be processed even the cursor is outside of node, <span class="keyword">if</span> drag is already started
- Drag provides correct handle of several touches. Drag can switch between them (no more scroll gliches with position)
- Drag have <span class="global">next</span> events:
- on_touch_start (self)
- on_touch_end (self)
- on_drag_start (self)
- on_drag (self, dx, dy)
- on_drag_end (self)
- You can restriction side of dragging by changing _drag.can_x_ <span class="keyword">and</span> _drag.can_y_ fields
- You can setup drag deadzone to detect, when dragging is started (_by default <span class="number">10</span> pixels_)
</pre>
</li>
<li><p>[Breaking changes] Druid <em>Scroll</em> component fully reworked. Input logic moved to <em>Drag</em> component</p>
<pre>
- Update scroll documentation
- Change constructor order params
- Change _scroll:set_border_ to _scroll:set_size_
- Scroll now contains from view <span class="keyword">and</span> content node
- _View node_ - static node, which size determine the <span class="string">"camera"</span> zone
- _Content node_ - dynamic node, moving by _Scroll_ component
- Scroll will be disabled only <span class="keyword">if</span> content size equals to view size (by width <span class="keyword">or</span> height separatly)
- You can adjust start scroll size via _.gui_ scene. Just setup correct node size
- Different anchoring is supported (<span class="keyword">for</span> easier layouting)
- Function _scroll_to_ now accept position relative to _content node_. It's more easier <span class="keyword">for</span> handling. _Example:_ <span class="keyword">if</span> you have children node of _content_node_, you can pass this node position to scroll to this.
- **Resolve #<span class="number">52</span>**: _Content node size_ now can be less than _view node size_. In this case, content will be scrolled only inside _view size_ (can be disabled via style field: _SMALL_CONTENT_SCROLL_)
- **Fix #<span class="number">50</span>**: If style.SOFT_ZONE_SIZE equals to [<span class="number">0.</span>.<span class="number">1</span>], scroll can be disappeared
</pre>
</li>
<li><p>Druid <em>Grid</em> Update</p>
<pre>
- Anchor by default equals to node pivot (so, more component settings <span class="keyword">in</span> _.gui_ settings) (#<span class="number">51</span>)
- Function <span class="backtick"><code>grid:clear</code></span> now don't delete any GUI nodes. Druid will <span class="keyword">not</span> care about <span class="backtick"><code>gui.delete_node</code></span> logic anymore (#<span class="number">56</span>)
</pre>
</li>
<li><p>Druid <em>Hover</em> component now have two <em>hover</em> events (#49):</p>
<pre>
- _on_hover_ is usual hover event. Trigger only <span class="keyword">if</span> touch <span class="keyword">or</span> mouse action_id pressed on node
- _on_mouse_hover_ action on node without action_id (desktop mouse over). Works only on desktop platform
</pre>
</li>
<li><p>Styles update:</p>
<pre>
- Styles <span class="global">table</span> now can be empty, every component have their default style values
- Remove <span class="backtick"><code>component:get_style</code></span> <span class="keyword">function</span>. Now you can only set styles
- To get style values <span class="keyword">in</span> component, add <span class="backtick"><code>component:on_style_change</code></span> <span class="keyword">function</span>. It's invoked on <span class="backtick"><a href="../modules/component.html#set_style">component:set_style</a></span> <span class="keyword">function</span>
- You can look up default values inside <span class="backtick"><code>component:on_style_change</code></span> <span class="keyword">function</span> <span class="keyword">or</span> style component API on [Druid API](https://insality.github.<span class="global">io</span>/druid/index.html)
</pre>
</li>
<li><p>Druid update:</p>
<pre>
- Now <span class="keyword">function</span> <span class="backtick"><code>druid:remove</code></span> remove instance <span class="keyword">and</span> all instance children components. No more manual deleting child components (#<span class="number">41</span>)
</pre>
</li>
<li><p><strong>Fix:</strong> Blocker component bug (blocker had very high priority, so it's block even button components, created after blocker)</p></li>
<li><p><strong>Fix #58:</strong> Bug, when druid instance should be always named <a href="../modules/druid.html#">druid</a> (ex: <code>self.druid = druid.new(self)</code>)</p></li>
<li><p><strong>Fix #53:</strong> Bug with final <em>Druid instance</em> without any components</p></li>
</ul>
<h3>Druid 0.5.0:</h3>
<p>Besides a lot of fixes (thanks for feedback!) two components was add: <em>StaticGrid</em> and <em>DynamicGrid</em> instead of usual <em>Grid</em> component (it is deprecated now).
Add <em>component:set</em>input<em>enabled</em> for basic component class. So you can enable/disable user input for any component.
Finaly implemented <em>on</em>layout<em>changed</em> support. Druid components now will try keep their data between layout changing! You also can use this callback in your custom components.
Also check <em>component.template.lua</em> what you can use for your own custom components!</p>
<ul>
<li><strong>#77</strong> Grid update:
<pre>
- The _grid_ component now is __deprecated__. Use _static_grid_ instead. Druid will show you deprecated message, <span class="keyword">if</span> you still using _grid_ component
- __[BREAKING]__ Remove the _grid:set_offset_ grid functions. To adjust the distance between nodes inside grid - setup correct node sizes
- Add _static_grid_ component
- The behaviour like previous _grid_ component
- Have constant element size, so have ability to precalculate positions, indexes <span class="keyword">and</span> size of content
- By default, <span class="keyword">not</span> shifting elements on removing element. Add _is_shift_ flag to _static_grid:remove_ <span class="keyword">function</span>
- This grid can spawn elements with several rows <span class="keyword">and</span> columns
- Add _dynamic_grid_ component
- Can have different element size. So have no ability to precalculate stuff like _static_grid_
- This grid can't have gaps between elements. You will get the <span class="global">error</span>, <span class="keyword">if</span> spawn element far away from other elements
- The grid can spawn elements only <span class="keyword">in</span> row <span class="keyword">or</span> <span class="keyword">in</span> column
- The grid node should have __West__, __East__, __South__ <span class="keyword">or</span> __North__ pivot (vertical <span class="keyword">or</span> horizontal element placement)
- Able to shift nodes left <span class="keyword">or</span> right on _grid:add_ / _grid:remove_ functions
</pre>
</li>
<li>Scroll update:
<pre>
- Add _scroll:set_vertical_scroll_ <span class="keyword">and</span> _scroll:set_horizontal_scroll_ <span class="keyword">for</span> disable scroll sides
- Add _scroll:bind_grid_ <span class="keyword">function</span>. Now is possible to bind Druid Grid component (Static <span class="keyword">or</span> Dynamic) to the scroll <span class="keyword">for</span> auto refresh the scroll size on grid nodes changing
</pre>
</li>
<li><strong>#37</strong> Add <em>on</em>layout<em>change</em> support. Druid will keep and restore GUI component data between changing game layout. Override function <em>on</em>layout<em>change</em> in your custom components to do stuff you need.</li>
<li><strong>#85</strong> Move several components from <code>base</code> folder to <code>extended</code>. In future to use them, you have to register them manually. This is done for decrease build size by excluding unused components</li>
<li><strong>Fix #61:</strong> Button component: fix button animation node creation</li>
<li><strong>Fix #64:</strong> Hover component: wrong mouse_hover default state</li>
<li><strong>Fix #71:</strong> Blocker: blocker now correct block mouse hover event</li>
<li><strong>Fix #72:</strong> Fix <code>return nil</code> in some <code>on_input</code> functions</li>
<li><strong>Fix #74:</strong> <strong>[BREAKING]</strong> Fix typo: strech -> stretch. Scroll function <code>set_extra_stretch_size</code> renamed</li>
<li><strong>Fix #76:</strong> Add params for lang text localization component</li>
<li><strong>Fix #79:</strong> Fix <em>druid:remove</em> inside on_input callback</li>
<li><strong>Fix #80:</strong> Fix <em>hover:set</em>enable_ typo function call</li>
<li><strong>Fix #88:</strong> Add <em>component:set</em>input<em>enabled</em> function to enable/disable input for druid component. Now you can disable input of any druid component, even complex (with other components inside)</li>
<li>Add <code>component.template.lua</code> as template for Druid custom component</li>
<li>Update the example app</li>
</ul>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,162 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Button">Button </a></li>
<li><a href="#Text">Text </a></li>
<li><a href="#Blocker">Blocker </a></li>
<li><a href="#Back_Handler">Back Handler </a></li>
<li><a href="#Locale">Locale </a></li>
<li><a href="#Timer">Timer </a></li>
<li><a href="#Progress">Progress </a></li>
<li><a href="#Scroll">Scroll </a></li>
<li><a href="#Grid">Grid </a></li>
<li><a href="#Slider">Slider </a></li>
<li><a href="#Checkbox">Checkbox </a></li>
<li><a href="#Checkbox_group">Checkbox group </a></li>
<li><a href="#Radio_group">Radio group </a></li>
<li><a href="#Hover">Hover </a></li>
<li><a href="#Input">Input </a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><strong>Druid components</strong></li>
<li><a href="../topics/creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/examples.md.html">Examples</a></li>
<li><a href="../topics/styles.md.html">Styles</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
</div>
<div id="content">
<h1>Druid components</h1>
<p><a name="Button"></a></p>
<h2>Button</h2>
<p>Basic game button</p>
<p><a name="Text"></a></p>
<h2>Text</h2>
<p>Wrap on text node with text size adjusting</p>
<p><a name="Blocker"></a></p>
<h2>Blocker</h2>
<p>Block input in node zone</p>
<p><a name="Back_Handler"></a></p>
<h2>Back Handler</h2>
<p>Handle back button (Android, backspace)</p>
<p><a name="Locale"></a></p>
<h2>Locale</h2>
<p>Text component with handle localization system</p>
<p><a name="Timer"></a></p>
<h2>Timer</h2>
<p>Run timer on text node</p>
<p><a name="Progress"></a></p>
<h2>Progress</h2>
<p>Basic progress bar</p>
<p><a name="Scroll"></a></p>
<h2>Scroll</h2>
<p>Basic scroll component</p>
<p><a name="Grid"></a></p>
<h2>Grid</h2>
<p>Component for manage node positions</p>
<p><a name="Slider"></a></p>
<h2>Slider</h2>
<p>Basic slider component</p>
<p><a name="Checkbox"></a></p>
<h2>Checkbox</h2>
<p>Basic checkbox component</p>
<p><a name="Checkbox_group"></a></p>
<h2>Checkbox group</h2>
<p>Several checkboxes in one group</p>
<p><a name="Radio_group"></a></p>
<h2>Radio group</h2>
<p>Several checkboxes in one group with single choice</p>
<p><a name="Hover"></a></p>
<h2>Hover</h2>
<p>Trigger component for check node hover state</p>
<p><a name="Input"></a></p>
<h2>Input</h2>
<p>Component to process user text input</p>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-03-21 22:59:46 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,172 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/components.md.html">Druid components</a></li>
<li><strong>Custom components</strong></li>
<li><a href="../topics/druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/online_example.md.html">Online example</a></li>
<li><a href="../topics/styles.md.html">Styles</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
</div>
<div id="content">
<h2>Custom components</h2>
<p>Add your custom components via <a href="../modules/druid.html#register">druid.register</a></p>
<pre>
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="keyword">local</span> my_component = <span class="global">require</span>(<span class="string">"my.amazing.component"</span>)
<span class="keyword">local</span> <span class="keyword">function</span> init(self)
druid.register(<span class="string">"my_component"</span>, my_component)
<span class="keyword">end</span>
</pre>
<p>Basic custom component template looks like this:</p>
<pre>
<span class="keyword">local</span> const = <span class="global">require</span>(<span class="string">"druid.const"</span>)
<span class="keyword">local</span> M = {}
M.interest = { const.ON_INPUT }
<span class="keyword">function</span> M.init(self, ...)
<span class="comment">-- Component constructor
</span><span class="keyword">end</span>
<span class="comment">-- Call only if exist interest: const.ON_UPDATE
</span><span class="keyword">function</span> M.update(self, dt)
<span class="keyword">end</span>
<span class="comment">-- Call only if exist interest: const.ON_INPUT or const.ON_SWIPE
</span><span class="keyword">function</span> M.on_input(self, action_id, action)
<span class="keyword">end</span>
<span class="comment">-- Call only if exist interest: const.ON_MESSAGE
</span><span class="keyword">function</span> M.on_message(self, message_id, message, sender)
<span class="keyword">end</span>
<span class="comment">-- Call only if swipe was started on another component (ex. scroll)
</span><span class="keyword">function</span> M.on_swipe(self)
<span class="keyword">end</span>
<span class="keyword">return</span> M
</pre>
<h2>Best practice on custom components</h2>
<p>On each component recomended describe component schema in next way:</p>
<pre>
<span class="comment">-- Component module
</span><span class="keyword">local</span> helper = <span class="global">require</span>(<span class="string">"druid.helper"</span>)
<span class="keyword">local</span> M = {}
<span class="keyword">local</span> SCHEME = {
ROOT = <span class="string">"/root"</span>,
ITEM = <span class="string">"/item"</span>,
TITLE = <span class="string">"/title"</span>
}
<span class="comment">-- TODO: Rework self.template/self.nodes
</span><span class="comment">-- Make self._inner_data? { component_name, template, nodes }
</span><span class="keyword">function</span> M.init(self, template_name, node_table)
<span class="comment">-- If component use template, setup it:
</span> self.template = template_name
<span class="comment">-- If component was cloned with gui.clone_tree, pass his nodes
</span> self.nodes = node_table
<span class="comment">-- helper can get node from gui/template/table
</span> <span class="keyword">local</span> root = helper.node(self, SCHEME.ROOT)
<span class="comment">-- This component can spawn another druid components:
</span> <span class="keyword">local</span> druid = helper.get_druid(self)
<span class="comment">-- Button self on callback is self of _this_ component
</span> <span class="keyword">local</span> button = druid:new_button(...)
<span class="comment">-- helper can return you the component style
</span> <span class="keyword">local</span> my_style = helper.get_style(self, <span class="string">"component_name"</span>)
<span class="keyword">end</span>
</pre>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-03-21 22:00:04 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,200 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Overview">Overview </a></li>
<li><a href="#Custom_components">Custom components </a></li>
<li><a href="#Best_practice_on_custom_components">Best practice on custom components </a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/components.md.html">Druid components</a></li>
<li><strong>Creating custom components</strong></li>
<li><a href="../topics/druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/examples.md.html">Examples</a></li>
<li><a href="../topics/styles.md.html">Styles</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
</div>
<div id="content">
<h1>Creating custom components</h1>
<p><a name="Overview"></a></p>
<h2>Overview</h2>
<p>Druid allows you to create your custom components from druid basic components or other custom components</p>
<p><a name="Custom_components"></a></p>
<h2>Custom components</h2>
<p>Basic custom component template looks like this:</p>
<pre>
<span class="keyword">local</span> const = <span class="global">require</span>(<span class="string">"druid.const"</span>)
<span class="keyword">local</span> component = <span class="global">require</span>(<span class="string">"druid.component"</span>)
<span class="keyword">local</span> M = component.create(<span class="string">"your_component"</span>)
<span class="comment">-- Component constructor
</span><span class="keyword">function</span> M.init(self, ...)
<span class="keyword">end</span>
<span class="comment">-- Call only if exist interest: const.ON_UPDATE
</span><span class="keyword">function</span> M.update(self, dt)
<span class="keyword">end</span>
<span class="comment">-- Call only if exist interest: const.ON_INPUT or const.ON_INPUT_HIGH
</span><span class="keyword">function</span> M.on_input(self, action_id, action)
<span class="keyword">end</span>
<span class="comment">-- Call only if exist interest: const.ON_MESSAGE
</span><span class="keyword">function</span> M.on_message(self, message_id, message, sender)
<span class="keyword">end</span>
<span class="comment">-- Call only if component with ON_CHANGE_LANGUAGE interest
</span><span class="keyword">function</span> M.on_change_language(self)
<span class="keyword">end</span>
<span class="comment">-- Call only if component with ON_LAYOUT_CHANGE interest
</span><span class="keyword">function</span> M.on_layout_change(self)
<span class="keyword">end</span>
<span class="keyword">return</span> M
</pre>
<p>Add your custom component to druid via <a href="../modules/druid.html#register">druid.register</a></p>
<pre>
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="keyword">local</span> my_component = <span class="global">require</span>(<span class="string">"my.amazing.component"</span>)
<span class="keyword">local</span> <span class="keyword">function</span> init(self)
druid.register(<span class="string">"my_component"</span>, my_component)
<span class="keyword">end</span>
</pre>
<h3>Interest</h3>
<p>Interest - is a way to indicate what events your component will respond to.
There is next interests in druid:
- <strong>ON_MESSAGE</strong> - component will receive messages from on_message</p>
<ul>
<li><p><strong>ON_UPDATE</strong> - component will be updated from update</p></li>
<li><p><strong>ON<em>INPUT</em>HIGH</strong> - component will receive input from on<em>input, before other components with ON</em>INPUT</p></li>
<li><p><strong>ON_INPUT</strong> - component will receive input from on<em>input, after other components with ON</em>INPUT_HIGH</p></li>
<li><p><strong>ON<em>CHANGE</em>LANGUAGE</strong> - will call <em>on</em>change<em>language</em> function on language change trigger</p></li>
<li><p><strong>ON<em>LAYOUT</em>CHANGED</strong> will call <em>on</em>layout<em>change</em> function on layout change trigger</p></li>
</ul>
<p><a name="Best_practice_on_custom_components"></a></p>
<h2>Best practice on custom components</h2>
<p>On each component recomended describe component scheme in next way:</p>
<pre>
<span class="comment">-- Component module
</span><span class="keyword">local</span> component = <span class="global">require</span>(<span class="string">"druid.component"</span>)
<span class="keyword">local</span> M = component.create(<span class="string">"your_component"</span>)
<span class="keyword">local</span> SCHEME = {
ROOT = <span class="string">"/root"</span>,
ITEM = <span class="string">"/item"</span>,
TITLE = <span class="string">"/title"</span>
}
<span class="keyword">function</span> M.init(self, template_name, node_table)
<span class="comment">-- If component use template, setup it:
</span> self:set_template(template_name)
<span class="comment">-- If component was cloned with gui.clone_tree, pass his nodes
</span> self:set_nodes(node_table)
<span class="comment">-- helper can get node from gui/template/table
</span> <span class="keyword">local</span> root = self:get_node(SCHEME.ROOT)
<span class="comment">-- This component can spawn another druid components:
</span> <span class="keyword">local</span> druid = self:get_druid()
<span class="comment">-- Button self on callback is self of _this_ component
</span> <span class="keyword">local</span> button = druid:new_button(...)
<span class="comment">-- helper can return you the component style for current component
</span> <span class="comment">-- It return by component name from
</span> <span class="keyword">local</span> my_style = self:get_style()
<span class="keyword">end</span>
</pre>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-03-21 22:59:46 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,96 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Overview">Overview </a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/components.md.html">Druid components</a></li>
<li><a href="../topics/creating_custom_components.md.html">Creating custom components</a></li>
<li><strong>Druid assets</strong></li>
<li><a href="../topics/examples.md.html">Examples</a></li>
<li><a href="../topics/styles.md.html">Styles</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
</div>
<div id="content">
<h1>Druid assets</h1>
<p><a name="Overview"></a></p>
<h2>Overview</h2>
<p>I've created <a href="https://github.com/Insality/druid-assets">druid-assets repository</a> to make a <em>marketplace</em> with custom styles and components.</p>
<p>Any of druid users can push their own components and styles to share it with the other users</p>
<p>Also, this marketplace is great example to how you can create your custom components</p>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-03-21 22:59:46 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,94 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Overview">Overview </a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/components.md.html">Druid components</a></li>
<li><a href="../topics/creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/druid_assets.md.html">Druid assets</a></li>
<li><strong>Examples</strong></li>
<li><a href="../topics/styles.md.html">Styles</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
</div>
<div id="content">
<h1>Examples</h1>
<p><a name="Overview"></a></p>
<h2>Overview</h2>
<p>See the <a href="https://github.com/Insality/druid/tree/develop/example/kenney">example folder</a> for examples of how to use Druid</p>
<p>Try the HTML5 version of the example app</p>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-03-21 22:59:46 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,161 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/01-components.md.html">01-components</a></li>
<li><a href="../topics/02-creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/03-styles.md.html">Styles</a></li>
<li><a href="../topics/04-druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/05-examples.md.html">Examples</a></li>
<li><a href="../topics/changelog.md.html">Druid 0.3.0:</a></li>
<li><strong>faq</strong></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.drag.html">druid.drag</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.static_grid.html">druid.static_grid</a></li>
<li><a href="../modules/druid.swipe.html">druid.swipe</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.dynamic_grid.html">druid.dynamic_grid</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
</div>
<div id="content">
<h1>Druid FAQ</h1>
<blockquote>
<p><em>Have questions about Druid? Ask me!</em>
<em>Here is questions you might have</em></p>
</blockquote>
<h3>Q: Why I want use Druid?</h3>
<p><strong>A:</strong> ---</p>
<h3>Q: How to remove the Druid component instance?</h3>
<p><strong>A:</strong> Any created <strong>Druid</strong> component can be removed with <em>druid:remove</em>. <a href="https://insality.github.io/druid/modules/druid_instance.html#druid:remove">API reference link</a>.</p>
<h3>Q: How to make scroll work?</h3>
<p><strong>A:</strong> ---</p>
<h3>Q: How the input is processing?</h3>
<p><strong>A:</strong>
<em>SImply</em>: the <strong>Druid</strong> has a LIFO queue to check input. Last added buttons have more priority than first. Placing your buttons from behind to the front is correct in most cases.</p>
<h3>Q: For what purpose Blocker component is exist?</h3>
<p><strong>A:</strong> Component explanation <a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md#notes-2">here</a>.
With Blocker you can block input in some zone. It is useful for make unclickable zone in buttons or kind of buttons panel on other big button (ex. close windows on window background click)</p>
<h3>Q: Which stuff can I do with custom components?</h3>
<p><strong>A:</strong> Any of you can imagine! There is a lot of examples, but in general: custom components allow you place component and some game logic separately from other stuff. It will be reusable, easier for testing and developing.</p>
<p>For example it can be element in scroll with buttons, your custom GUI widget or even component with your game logic. Usually custom components going with templates. You can do several templates for single component module (for different visuals!)</p>
<p>Some examples of custom components you can find <a href="https://github.com/Insality/druid-assets">here</a>.</p>
<h3>Q: How *self:get_node()* is working?</h3>
<p><strong>A:</strong> The node can be placed in gui directly or can be cloned via *gui.clone_tree()*. Also nodes can be placed as templates, so full node id will be composed from template name and node name (in cloned nodes too).</p>
<p><strong>Druid</strong> component *self:get<em>node()* trying to search in all of this places. Use *self:set</em>template()* and *self:set<em>component</em>nodes()* for correct setup component nodes before any call of *self:get_node()*.</p>
<p>Remember, usually you should pass <em><strong>string name</strong> of the node</em>, not gui node itself. It's better and more druid-way. </p>
<h3>Q: My button in scroll is clickable outside the stencil node</h3>
<p><strong>A:</strong> Since <strong>Druid</strong> checking click node with <em>gui.pick</em>node_, stencil is not prevent this. You can setup additional click zone on your buttons with <em>button:set</em>click<em>zone</em>.</p>
<p>The usual Druid way after add button to the scroll do:</p>
<pre>
<span class="comment">-- Scroll view node usually is stencil node
</span>button:set_click_zone(scroll.view_node)
</pre>
<h3>Q: How to use EmmyLua annotations? <em>(from Druid 0.6.0)</em></h3>
<p><strong>A:</strong> Since the dependencies can't be processed by external editors, for use generated EmmyLua annotations you should copy the <em>annotations.lua</em> to your project. For EmmyLua it will be enough. Remember you can <em>restart emmylua server</em> for refresh the changes, if something goes wrong.
After the annotations is processed, you should point the type of druid in requires:</p>
<pre>
<span class="comment">---@type druid
</span><span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="comment">-- Now the autocomplete is working</span>
</pre>
<h3>Q: When I should use *on<em>layout</em>change*?</h3>
<p><strong>A:</strong> ---</p>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-09-29 23:46:16 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,86 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/components.md.html">Druid components</a></li>
<li><a href="../topics/create_custom_components.md.html">Custom components</a></li>
<li><a href="../topics/druid_assets.md.html">Druid assets</a></li>
<li><strong>Online example</strong></li>
<li><a href="../topics/styles.md.html">Styles</a></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
</div>
<div id="content">
<h1>Online example</h1>
<p>Check druid --here-- (link)</p>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-03-21 22:00:04 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -1,145 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Defold Druid UI Library</title>
<link rel="stylesheet" href="../ldoc_fixed.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>Druid</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Overview">Overview </a></li>
<li><a href="#Usage">Usage </a></li>
<li><a href="#Create_custom_components">Create custom components </a></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/components.md.html">Druid components</a></li>
<li><a href="../topics/creating_custom_components.md.html">Creating custom components</a></li>
<li><a href="../topics/druid_assets.md.html">Druid assets</a></li>
<li><a href="../topics/examples.md.html">Examples</a></li>
<li><strong>Styles</strong></li>
<li><a href="../topics/README.md.html">README</a></li>
</ul>
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/druid.back_handler.html">druid.back_handler</a></li>
<li><a href="../modules/druid.blocker.html">druid.blocker</a></li>
<li><a href="../modules/druid.button.html">druid.button</a></li>
<li><a href="../modules/druid.checkbox.html">druid.checkbox</a></li>
<li><a href="../modules/druid.checkbox_group.html">druid.checkbox_group</a></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.hover.html">druid.hover</a></li>
<li><a href="../modules/druid.input.html">druid.input</a></li>
<li><a href="../modules/druid.lang_text.html">druid.lang_text</a></li>
<li><a href="../modules/druid.progress.html">druid.progress</a></li>
<li><a href="../modules/druid.radio_group.html">druid.radio_group</a></li>
<li><a href="../modules/druid.scroll.html">druid.scroll</a></li>
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<li><a href="../modules/druid_event.html">druid_event</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
</div>
<div id="content">
<h1>Styles</h1>
<p><a name="Overview"></a></p>
<h2>Overview</h2>
<p>Styles - set of functions and parameters for components to customize their behavior.</p>
<p>Styles is a table, where key is name of component, and value is style table for this component.</p>
<p>In component API documentation, you can find the style API for this component. Or just lookup for existing styles and modify them.</p>
<p><a name="Usage"></a></p>
<h2>Usage</h2>
<p>Setup default druid style for all druid instances via <code>druid.set_default_style</code></p>
<pre>
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="keyword">local</span> my_style = <span class="global">require</span>(<span class="string">"my.amazing.style"</span>)
<span class="keyword">local</span> <span class="keyword">function</span> init(self)
druid.set_default_style(my_style)
<span class="keyword">end</span>
</pre>
<p>Setup custom style to specific druid instance:</p>
<pre>
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="keyword">local</span> my_style = <span class="global">require</span>(<span class="string">"my.amazing.style"</span>)
<span class="keyword">local</span> <span class="keyword">function</span> init(self)
<span class="comment">-- This druid instance will be use my_style as default
</span> self.druid = druid.new(self, my_style)
<span class="keyword">end</span>
</pre>
<p>Change component style with <em>set</em>style_ function</p>
<pre>
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
<span class="keyword">local</span> my_style = <span class="global">require</span>(<span class="string">"my.amazing.style"</span>)
<span class="keyword">local</span> <span class="keyword">function</span> init(self)
self.druid = druid.new(self)
self.button = self.druid:new_button(self, <span class="string">"node"</span>)
<span class="comment">-- Setup custom style for specific component
</span> self.button:set_style(my_style)
<span class="keyword">end</span>
</pre>
<p><a name="Create_custom_components"></a></p>
<h2>Create custom components</h2>
<p>Styles is just lua table, so it can be described in just one single file
<strong>TODO</strong></p>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2020-03-21 22:59:46 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View File

@ -350,7 +350,7 @@ end
--- Create button basic component
-- @tparam DruidInstance self
-- @tparam args ... button init args
-- @treturn Component button component
-- @treturn Button button component
function DruidInstance.new_button(self, ...)
return DruidInstance.create(self, button, ...)
end
@ -359,7 +359,7 @@ end
--- Create blocker basic component
-- @tparam DruidInstance self
-- @tparam args ... blocker init args
-- @treturn Component blocker component
-- @treturn Blocker blocker component
function DruidInstance.new_blocker(self, ...)
return DruidInstance.create(self, blocker, ...)
end
@ -368,7 +368,7 @@ end
--- Create back_handler basic component
-- @tparam DruidInstance self
-- @tparam args ... back_handler init args
-- @treturn Component back_handler component
-- @treturn BackHandler back_handler component
function DruidInstance.new_back_handler(self, ...)
return DruidInstance.create(self, back_handler, ...)
end
@ -377,7 +377,7 @@ end
--- Create hover basic component
-- @tparam DruidInstance self
-- @tparam args ... hover init args
-- @treturn Component hover component
-- @treturn Hover hover component
function DruidInstance.new_hover(self, ...)
return DruidInstance.create(self, hover, ...)
end
@ -386,7 +386,7 @@ end
--- Create text basic component
-- @tparam DruidInstance self
-- @tparam args ... text init args
-- @treturn Component text component
-- @treturn Tet text component
function DruidInstance.new_text(self, ...)
return DruidInstance.create(self, text, ...)
end
@ -396,7 +396,7 @@ end
-- Deprecated
-- @tparam DruidInstance self
-- @tparam args ... grid init args
-- @treturn Component grid component
-- @treturn StaticGrid grid component
function DruidInstance.new_grid(self, ...)
helper.deprecated("The druid:new_grid is deprecated. Please use druid:new_static_grid instead")
return DruidInstance.create(self, static_grid, ...)
@ -406,7 +406,7 @@ end
--- Create static grid basic component
-- @tparam DruidInstance self
-- @tparam args ... grid init args
-- @treturn Component grid component
-- @treturn StaticGrid grid component
function DruidInstance.new_static_grid(self, ...)
return DruidInstance.create(self, static_grid, ...)
end
@ -415,7 +415,7 @@ end
--- Create scroll basic component
-- @tparam DruidInstance self
-- @tparam args ... scroll init args
-- @treturn Component scroll component
-- @treturn Scroll scroll component
function DruidInstance.new_scroll(self, ...)
return DruidInstance.create(self, scroll, ...)
end
@ -424,7 +424,7 @@ end
--- Create swipe basic component
-- @tparam DruidInstance self
-- @tparam args ... swipe init args
-- @treturn Component swipe component
-- @treturn Swipe swipe component
function DruidInstance.new_swipe(self, ...)
return DruidInstance.create(self, swipe, ...)
end
@ -433,7 +433,7 @@ end
--- Create drag basic component
-- @tparam DruidInstance self
-- @tparam args ... drag init args
-- @treturn Componetn drag component
-- @treturn Drag drag component
function DruidInstance.new_drag(self, ...)
return DruidInstance.create(self, drag, ...)
end
@ -442,7 +442,7 @@ end
--- Create dynamic grid component
-- @tparam DruidInstance self
-- @tparam args ... grid init args
-- @treturn Component grid component
-- @treturn DynamicGrid grid component
function DruidInstance.new_dynamic_grid(self, ...)
-- return helper.extended_component("dynamic_grid")
return DruidInstance.create(self, dynamic_grid, ...)
@ -452,7 +452,7 @@ end
--- Create lang_text component
-- @tparam DruidInstance self
-- @tparam args ... lang_text init args
-- @treturn Component lang_text component
-- @treturn LangText lang_text component
function DruidInstance.new_lang_text(self, ...)
-- return helper.extended_component("lang_text")
return DruidInstance.create(self, lang_text, ...)
@ -462,7 +462,7 @@ end
--- Create slider component
-- @tparam DruidInstance self
-- @tparam args ... slider init args
-- @treturn Component slider component
-- @treturn Slider slider component
function DruidInstance.new_slider(self, ...)
-- return helper.extended_component("slider")
return DruidInstance.create(self, slider, ...)
@ -472,7 +472,7 @@ end
--- Create checkbox component
-- @tparam DruidInstance self
-- @tparam args ... checkbox init args
-- @treturn Component checkbox component
-- @treturn Checkbox checkbox component
function DruidInstance.new_checkbox(self, ...)
-- return helper.extended_component("checkbox")
return DruidInstance.create(self, checkbox, ...)
@ -482,7 +482,7 @@ end
--- Create input component
-- @tparam DruidInstance self
-- @tparam args ... input init args
-- @treturn Component input component
-- @treturn Input input component
function DruidInstance.new_input(self, ...)
-- return helper.extended_component("input")
return DruidInstance.create(self, input, ...)
@ -492,7 +492,7 @@ end
--- Create checkbox_group component
-- @tparam DruidInstance self
-- @tparam args ... checkbox_group init args
-- @treturn Component checkbox_group component
-- @treturn CheckboxGroup checkbox_group component
function DruidInstance.new_checkbox_group(self, ...)
-- return helper.extended_component("checkbox_group")
return DruidInstance.create(self, checkbox_group, ...)
@ -502,7 +502,7 @@ end
--- Create radio_group component
-- @tparam DruidInstance self
-- @tparam args ... radio_group init args
-- @treturn Component radio_group component
-- @treturn RadioGroup radio_group component
function DruidInstance.new_radio_group(self, ...)
-- return helper.extended_component("radio_group")
return DruidInstance.create(self, radio_group, ...)
@ -512,7 +512,7 @@ end
--- Create timer component
-- @tparam DruidInstance self
-- @tparam args ... timer init args
-- @treturn Component timer component
-- @treturn Timer timer component
function DruidInstance.new_timer(self, ...)
-- return helper.extended_component("timer")
return DruidInstance.create(self, timer, ...)
@ -522,7 +522,7 @@ end
--- Create progress component
-- @tparam DruidInstance self
-- @tparam args ... progress init args
-- @treturn Component progress component
-- @treturn Progress progress component
function DruidInstance.new_progress(self, ...)
-- return helper.extended_component("progress")
return DruidInstance.create(self, progress, ...)