Documentation experiments

This commit is contained in:
Insality 2020-02-23 22:57:44 +03:00
parent 5c576e6059
commit 822db35e84
25 changed files with 1071 additions and 1057 deletions

View File

@ -9,13 +9,15 @@ Simple to-do for Druid Alpha 0.2.0
+ better name for slider component? Slider is ok
+ Druid store assets - separate repository with rich components (progress_rich migrate)
+ refactor on_swipe. To on_scroll? Add input priority
- separate custom data and predefined fields in components?
+ separate custom data and predefined fields in components? Every component have their fields and events
- add init/remove stuff for every style in component. How to set custom sprites for button states?
- unify component api (get/set/to and other general stuff)
- add druid settings (add auto_focus input and other stuff)
- button add key trigger
- button polish, actions
- button and hover click restriction zone?
- unify component api (get/set/to and other general stuff)
- better callbacks for every components
- better scroll size management, check different cases. So implicit now
- better grid + scroll management

View File

@ -3,7 +3,7 @@ title='Defold Druid UI Library'
description='Documentation for Druid Library'
file={"./druid"}
package='druid'
sort=true
sort=false
dir='./docs'
style='!fixed'
format='discount'

View File

@ -145,7 +145,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-02-23 13:01:03 </i>
<i style="float:right;">Last updated 2020-02-23 22:54:59 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -38,15 +38,12 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><strong>component</strong></li>
<li><a href="../modules/druid.html">druid</a></li>
<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.helper.html">druid.helper</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>
@ -55,7 +52,10 @@
<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><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.helper.html">druid.helper</a></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
@ -70,54 +70,54 @@
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Component.create">Component.create(name, interest)</a></td>
<td class="summary">Create new component.</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="#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_interests">get_interests()</a></td>
<td class="summary">Get current component interests</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="#get_style">get_style()</a></td>
<td class="summary">Get current component style table</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="#set_context">set_context(context)</a></td>
<td class="summary">Set current component context</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="#set_style">set_style(style)</a></td>
<td class="summary">Set current component style table</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="#set_template">set_template(template)</a></td>
<td class="summary">Set 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="#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="#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_druid">get_druid()</a></td>
<td class="summary">Return druid with context of calling component.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#setup_component">setup_component(table, table)</a></td>
<td class="summary">Setup component context and his style table</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/>
@ -128,23 +128,120 @@
<dl class="function">
<dt>
<a name = "Component.create"></a>
<strong>Component.create(name, interest)</strong>
<a name = "get_style"></a>
<strong>get_style()</strong>
</dt>
<dd>
Create new component. It will inheritance from basic
druid component.
Get current component style table
<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 style table
</ol>
</dd>
<dt>
<a name = "set_style"></a>
<strong>set_style(style)</strong>
</dt>
<dd>
Set current component style table
<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>
<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>
List of component's interest
Druid style module
</li>
</ul>
</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 = "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 = "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 = "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>
@ -174,21 +271,21 @@
</dd>
<dt>
<a name = "get_druid"></a>
<strong>get_druid()</strong>
<a name = "set_context"></a>
<strong>set_context(context)</strong>
</dt>
<dd>
Return druid with context of calling component.
Use it to create component inside of other components.
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>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Druid</span></span>
Druid instance with component context
</ol>
@ -215,148 +312,25 @@
</dd>
<dt>
<a name = "get_nodes"></a>
<strong>get_nodes()</strong>
<a name = "get_druid"></a>
<strong>get_druid()</strong>
</dt>
<dd>
Get current component nodes
Return druid with context of calling component.
Use it to create component inside of other components.
<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
<span class="types"><span class="type">Druid</span></span>
Druid instance with component context
</ol>
</dd>
<dt>
<a name = "get_style"></a>
<strong>get_style()</strong>
</dt>
<dd>
Get current component style table
<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 style table
</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 = "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 = "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 = "set_style"></a>
<strong>set_style(style)</strong>
</dt>
<dd>
Set current component style table
<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 = "setup_component"></a>
@ -388,6 +362,32 @@
</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
</li>
</ul>
</dd>
</dl>
@ -396,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-02-23 13:01:03 </i>
<i style="float:right;">Last updated 2020-02-23 22:54:59 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -38,15 +38,12 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<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.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.helper.html">druid.helper</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>
@ -55,7 +52,10 @@
<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>
@ -151,7 +151,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-02-23 13:01:03 </i>
<i style="float:right;">Last updated 2020-02-23 22:54:59 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -34,15 +34,12 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<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.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.helper.html">druid.helper</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>
@ -51,7 +48,10 @@
<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>
@ -77,7 +77,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-02-23 13:01:03 </i>
<i style="float:right;">Last updated 2020-02-23 22:54:59 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -39,15 +39,12 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<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.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.helper.html">druid.helper</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>
@ -56,7 +53,10 @@
<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>
@ -73,49 +73,37 @@
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#disable_animation">disable_animation(self)</a></td>
<td class="summary">Disable all button animations</td>
</tr>
<tr>
<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>
<tr>
<td class="name" nowrap><a href="#init">init(self, node, callback[, params[, anim_node[, event]]])</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_callback">set_callback(self, callback)</a></td>
<td class="summary">Set usual button callback</td>
<td class="name" nowrap><a href="#disable_animation">disable_animation(self)</a></td>
<td class="summary">Disable all button animations</td>
</tr>
<tr>
<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_double_tap_callback">set_double_tap_callback(self, callback)</a></td>
<td class="summary">Get doubletap callback on this button</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_hold_callback">set_hold_callback(self, callback)</a></td>
<td class="summary">Repeat callback always, while holding button</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_long_tap_callback">set_long_tap_callback(self, callback)</a></td>
<td class="summary">Single callbacka after long_tap.</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="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="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="summary">Component style params</td>
</tr>
</table>
<br/>
@ -125,49 +113,6 @@
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "disable_animation"></a>
<strong>disable_animation(self)</strong>
</dt>
<dd>
Disable all button animations
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component instance
</li>
</ul>
</dd>
<dt>
<a name = "get_key_trigger"></a>
<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>
</li>
</ul>
</dd>
<dt>
<a name = "init"></a>
<strong>init(self, node, callback[, params[, anim_node[, event]]])</strong>
@ -213,24 +158,18 @@
</dd>
<dt>
<a name = "set_callback"></a>
<strong>set_callback(self, callback)</strong>
<a name = "disable_animation"></a>
<strong>disable_animation(self)</strong>
</dt>
<dd>
Set usual button callback
Disable all button animations
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
</li>
<li><span class="parameter">callback</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component instance
</li>
</ul>
@ -266,11 +205,11 @@
</dd>
<dt>
<a name = "set_double_tap_callback"></a>
<strong>set_double_tap_callback(self, callback)</strong>
<a name = "get_key_trigger"></a>
<strong>get_key_trigger(self)</strong>
</dt>
<dd>
Get doubletap callback on this button
Get key-code to trigger this button
<h3>Parameters:</h3>
@ -279,65 +218,6 @@
</li>
<li><span class="parameter">callback</span>
</li>
</ul>
</dd>
<dt>
<a name = "set_hold_callback"></a>
<strong>set_hold_callback(self, callback)</strong>
</dt>
<dd>
Repeat callback always, while holding button
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
</li>
<li><span class="parameter">callback</span>
</li>
</ul>
</dd>
<dt>
<a name = "set_long_tap_callback"></a>
<strong>set_long_tap_callback(self, callback)</strong>
</dt>
<dd>
Single callbacka after long_tap. No usual callback invoked
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
</li>
<li><span class="parameter">callback</span>
</li>
</ul>
@ -351,8 +231,8 @@
<dl class="function">
<dt>
<a name = "events"></a>
<strong>events</strong>
<a name = "Events"></a>
<strong>Events</strong>
</dt>
<dd>
Component events
@ -362,27 +242,19 @@
<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_hold_click</span>
<li><span class="parameter">on_repeated_click</span>
<span class="types"><span class="type">druid_event</span></span>
On repeated action button callback
</li>
<li><span class="parameter">on_long_click</span>
<span class="types"><span class="type">druid_event</span></span>
On long tap button callback
</li>
<li><span class="parameter">on_double_click</span>
<span class="types"><span class="type">druid_event</span></span>
On double tap button callback
</li>
</ul>
@ -392,8 +264,8 @@
</dd>
<dt>
<a name = "fields"></a>
<strong>fields</strong>
<a name = "Fields"></a>
<strong>Fields</strong>
</dt>
<dd>
Component fields
@ -401,9 +273,64 @@
<h3>Fields:</h3>
<ul>
<li><span class="parameter">Main</span>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
node
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">scale_from</span>
<span class="types"><span class="type">vector3</span></span>
Initial scale 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_anim</span>
<span class="types"><span class="type">boolean</span></span>
Is hover anim enabled
</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>
</dt>
<dd>
Component style params
<h3>Fields:</h3>
<ul>
<li><span class="parameter">on_click</span>
<span class="types"><span class="type">function</span></span>
(self, node)
</li>
<li><span class="parameter">on_hover</span>
<span class="types"><span class="type">function</span></span>
(self, node, hover_state)
</li>
</ul>
@ -419,7 +346,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-02-23 13:01:03 </i>
<i style="float:right;">Last updated 2020-02-23 22:54:59 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -34,15 +34,12 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<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.checkbox</strong></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.helper.html">druid.helper</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>
@ -51,7 +48,10 @@
<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>
@ -77,7 +77,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-02-23 13:01:03 </i>
<i style="float:right;">Last updated 2020-02-23 22:54:59 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -34,15 +34,12 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<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><strong>druid.checkbox_group</strong></li>
<li><a href="../modules/druid.grid.html">druid.grid</a></li>
<li><a href="../modules/druid.helper.html">druid.helper</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>
@ -51,7 +48,10 @@
<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>
@ -77,7 +77,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-02-23 13:01:03 </i>
<i style="float:right;">Last updated 2020-02-23 22:54:59 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -34,15 +34,12 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<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><strong>druid.grid</strong></li>
<li><a href="../modules/druid.helper.html">druid.helper</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>
@ -51,7 +48,10 @@
<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>
@ -75,7 +75,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-02-23 13:01:03 </i>
<i style="float:right;">Last updated 2020-02-23 22:54:59 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -38,15 +38,12 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<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><strong>druid.helper</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>
@ -55,7 +52,10 @@
<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><strong>druid.helper</strong></li>
<li><a href="../modules/druid_instance.html">druid_instance</a></li>
</ul>
@ -72,22 +72,22 @@
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#centrate_icon_with_text">centrate_icon_with_text([icon_node[, text_node[, margin=0]]])</a></td>
<td class="summary">Center two nodes.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#centrate_text_with_icon">centrate_text_with_icon([text_node][, icon_node], margin)</a></td>
<td class="summary">Center two nodes.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_pivot_offset">get_pivot_offset(pivot)</a></td>
<td class="summary">Get node offset for given gui pivot</td>
<td class="name" nowrap><a href="#centrate_icon_with_text">centrate_icon_with_text([icon_node[, text_node[, margin=0]]])</a></td>
<td class="summary">Center two nodes.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_enabled">is_enabled(node)</a></td>
<td class="summary">Check if node is enabled in gui hierarchy.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#get_pivot_offset">get_pivot_offset(pivot)</a></td>
<td class="summary">Get node offset for given gui pivot</td>
</tr>
</table>
<br/>
@ -97,6 +97,39 @@
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "centrate_text_with_icon"></a>
<strong>centrate_text_with_icon([text_node][, icon_node], margin)</strong>
</dt>
<dd>
Center two nodes.
Nodes will be center around 0 x position
text_node will be first (at left side)
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">text_node</span>
<span class="types"><span class="type">text</span></span>
Gui text node
(<em>optional</em>)
</li>
<li><span class="parameter">icon_node</span>
<span class="types"><span class="type">box</span></span>
Gui box node
(<em>optional</em>)
</li>
<li><span class="parameter">margin</span>
<span class="types"><span class="type">number</span></span>
Offset between nodes
</li>
</ul>
</dd>
<dt>
<a name = "centrate_icon_with_text"></a>
<strong>centrate_icon_with_text([icon_node[, text_node[, margin=0]]])</strong>
@ -132,33 +165,28 @@
</dd>
<dt>
<a name = "centrate_text_with_icon"></a>
<strong>centrate_text_with_icon([text_node][, icon_node], margin)</strong>
<a name = "is_enabled"></a>
<strong>is_enabled(node)</strong>
</dt>
<dd>
Center two nodes.
Nodes will be center around 0 x position
text_node will be first (at left side)
Check if node is enabled in gui hierarchy.
Return false, if node or any his parent is disabled
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">text_node</span>
<span class="types"><span class="type">text</span></span>
Gui text node
(<em>optional</em>)
</li>
<li><span class="parameter">icon_node</span>
<span class="types"><span class="type">box</span></span>
Gui box node
(<em>optional</em>)
</li>
<li><span class="parameter">margin</span>
<span class="types"><span class="type">number</span></span>
Offset between nodes
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
Is enabled in hierarchy
</ol>
@ -190,34 +218,6 @@
</dd>
<dt>
<a name = "is_enabled"></a>
<strong>is_enabled(node)</strong>
</dt>
<dd>
Check if node is enabled in gui hierarchy.
Return false, if node or any his parent is disabled
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
Is enabled in hierarchy
</ol>
</dd>
</dl>
@ -226,7 +226,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-02-23 13:01:03 </i>
<i style="float:right;">Last updated 2020-02-23 22:54:59 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -38,15 +38,12 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/component.html">component</a></li>
<li><strong>druid</strong></li>
<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.helper.html">druid.helper</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>
@ -55,7 +52,10 @@
<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><strong>druid</strong></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>
@ -88,14 +88,14 @@
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#new">new(context[, style])</a></td>
<td class="summary">Create Druid instance.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#register">register(name, module)</a></td>
<td class="summary">Register external druid component.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#new">new(context[, style])</a></td>
<td class="summary">Create Druid instance.</td>
</tr>
</table>
<br/>
@ -105,6 +105,33 @@
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "register"></a>
<strong>register(name, module)</strong>
</dt>
<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>
<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>
module name
</li>
<li><span class="parameter">module</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
lua table with component
</li>
</ul>
</dd>
<dt>
<a name = "new"></a>
<strong>new(context[, style])</strong>
@ -136,33 +163,6 @@
</dd>
<dt>
<a name = "register"></a>
<strong>register(name, module)</strong>
</dt>
<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>
<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>
module name
</li>
<li><span class="parameter">module</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
lua table with component
</li>
</ul>
</dd>
</dl>
@ -171,7 +171,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-02-23 13:01:03 </i>
<i style="float:right;">Last updated 2020-02-23 22:54:59 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -38,15 +38,12 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<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.helper.html">druid.helper</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>
@ -55,7 +52,10 @@
<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>
@ -72,14 +72,14 @@
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#button:set_click_zone">button:set_click_zone(self, zone)</a></td>
<td class="summary">Strict button click area.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#hover:init">hover:init(self, node, on_hover_callback)</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#button:set_click_zone">button:set_click_zone(self, zone)</a></td>
<td class="summary">Strict button click area.</td>
</tr>
</table>
<br/>
@ -89,32 +89,6 @@
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "button:set_click_zone"></a>
<strong>button:set_click_zone(self, zone)</strong>
</dt>
<dd>
Strict button click area. Useful for
no click events outside stencil node
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component instance
</li>
<li><span class="parameter">zone</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
</ul>
</dd>
<dt>
<a name = "hover:init"></a>
<strong>hover:init(self, node, on_hover_callback)</strong>
@ -143,6 +117,32 @@
</dd>
<dt>
<a name = "button:set_click_zone"></a>
<strong>button:set_click_zone(self, zone)</strong>
</dt>
<dd>
Strict button click area. Useful for
no click events outside stencil node
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component instance
</li>
<li><span class="parameter">zone</span>
<span class="types"><span class="type">node</span></span>
Gui node
</li>
</ul>
</dd>
</dl>
@ -151,7 +151,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-02-23 13:01:03 </i>
<i style="float:right;">Last updated 2020-02-23 22:54:59 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -38,15 +38,12 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<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.helper.html">druid.helper</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>
@ -55,7 +52,10 @@
<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>
@ -118,7 +118,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-02-23 13:01:03 </i>
<i style="float:right;">Last updated 2020-02-23 22:54:59 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -38,15 +38,12 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<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.helper.html">druid.helper</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>
@ -55,7 +52,10 @@
<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>
@ -73,30 +73,30 @@
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#empty">empty(self)</a></td>
<td class="summary">Empty a progress bar</td>
<td class="name" nowrap><a href="#init">init(self, node, key, init_value)</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<td class="name" nowrap><a href="#empty">empty(self)</a></td>
<td class="summary">Fill a progress bar and stop progress animation</td>
</tr>
<tr>
<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="#init">init(self, node, key, init_value)</a></td>
<td class="summary">Component init function</td>
</tr>
<tr>
<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>
<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(self, to)</a></td>
<td class="summary">Instant fill progress bar to value</td>
</tr>
<tr>
<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(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(self, to[, callback])</a></td>
<td class="summary">Start animation of a progress bar</td>
</tr>
@ -109,69 +109,6 @@
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "empty"></a>
<strong>empty(self)</strong>
</dt>
<dd>
Empty a progress bar
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component instance
</li>
</ul>
</dd>
<dt>
<a name = "empty"></a>
<strong>empty(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"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component instance
</li>
</ul>
</dd>
<dt>
<a name = "get"></a>
<strong>get(self)</strong>
</dt>
<dd>
Return current progress bar value
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component instance
</li>
</ul>
</dd>
<dt>
<a name = "init"></a>
<strong>init(self, node, key, init_value)</strong>
@ -206,11 +143,11 @@
</dd>
<dt>
<a name = "set_steps"></a>
<strong>set_steps(self, steps, callback)</strong>
<a name = "empty"></a>
<strong>empty(self)</strong>
</dt>
<dd>
Set points on progress bar to fire the callback
Fill a progress bar and stop progress animation
<h3>Parameters:</h3>
@ -219,13 +156,26 @@
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component instance
</li>
<li><span class="parameter">steps</span>
</ul>
</dd>
<dt>
<a name = "empty"></a>
<strong>empty(self)</strong>
</dt>
<dd>
Empty a progress bar
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Array of progress bar values
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Callback on intersect step value
Component instance
</li>
</ul>
@ -258,6 +208,56 @@
</dd>
<dt>
<a name = "get"></a>
<strong>get(self)</strong>
</dt>
<dd>
Return current progress bar value
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component instance
</li>
</ul>
</dd>
<dt>
<a name = "set_steps"></a>
<strong>set_steps(self, steps, callback)</strong>
</dt>
<dd>
Set points on progress bar to fire the callback
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component instance
</li>
<li><span class="parameter">steps</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Array of progress bar values
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Callback on intersect step value
</li>
</ul>
</dd>
<dt>
<a name = "to"></a>
@ -296,7 +296,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-02-23 13:01:03 </i>
<i style="float:right;">Last updated 2020-02-23 22:54:59 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -34,15 +34,12 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<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.helper.html">druid.helper</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>
@ -51,7 +48,10 @@
<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>
@ -77,7 +77,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-02-23 13:01:03 </i>
<i style="float:right;">Last updated 2020-02-23 22:54:59 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -38,15 +38,12 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<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.helper.html">druid.helper</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>
@ -55,7 +52,10 @@
<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>
@ -72,29 +72,29 @@
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init">init(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="#on_point_move">on_point_move(self, callback)</a></td>
<td class="summary">Set the callback on scrolling to point (if exist)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#scroll_to">scroll_to(vector3[, is_instant])</a></td>
<td class="summary">Start scroll to target point</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_border">set_border(self, border)</a></td>
<td class="summary">Set the scroll possibly area</td>
<td class="name" nowrap><a href="#init">init(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="#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_inert">set_inert(self, state)</a></td>
<td class="summary">Enable or disable scroll inert.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_points">set_points(self, points)</a></td>
<td class="summary">Set points of interest.</td>
<td class="name" nowrap><a href="#on_point_move">on_point_move(self, callback)</a></td>
<td class="summary">Set the callback on scrolling to point (if exist)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_border">set_border(self, border)</a></td>
<td class="summary">Set the scroll possibly area</td>
</tr>
</table>
@ -105,61 +105,6 @@
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong>init(self, index[, skip_cb])</strong>
</dt>
<dd>
Scroll to item in scroll by point index
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component instance
</li>
<li><span class="parameter">index</span>
<span class="types"><span class="type">number</span></span>
Point index
</li>
<li><span class="parameter">skip_cb</span>
<span class="types"><span class="type">boolean</span></span>
If true, skip the point callback
(<em>optional</em>)
</li>
</ul>
</dd>
<dt>
<a name = "on_point_move"></a>
<strong>on_point_move(self, callback)</strong>
</dt>
<dd>
Set the callback on scrolling to point (if exist)
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component instance
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Callback on scroll to point of interest
</li>
</ul>
</dd>
<dt>
<a name = "scroll_to"></a>
<strong>scroll_to(vector3[, is_instant])</strong>
@ -192,11 +137,11 @@
</dd>
<dt>
<a name = "set_border"></a>
<strong>set_border(self, border)</strong>
<a name = "init"></a>
<strong>init(self, index[, skip_cb])</strong>
</dt>
<dd>
Set the scroll possibly area
Scroll to item in scroll by point index
<h3>Parameters:</h3>
@ -205,9 +150,40 @@
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component instance
</li>
<li><span class="parameter">border</span>
<span class="types"><span class="type">vmath.vector3</span></span>
Size of scrolling area
<li><span class="parameter">index</span>
<span class="types"><span class="type">number</span></span>
Point index
</li>
<li><span class="parameter">skip_cb</span>
<span class="types"><span class="type">boolean</span></span>
If true, skip the point callback
(<em>optional</em>)
</li>
</ul>
</dd>
<dt>
<a name = "set_points"></a>
<strong>set_points(self, points)</strong>
</dt>
<dd>
Set points of interest.
Scroll will always centered on closer points
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component instance
</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
</li>
</ul>
@ -244,12 +220,11 @@
</dd>
<dt>
<a name = "set_points"></a>
<strong>set_points(self, points)</strong>
<a name = "on_point_move"></a>
<strong>on_point_move(self, callback)</strong>
</dt>
<dd>
Set points of interest.
Scroll will always centered on closer points
Set the callback on scrolling to point (if exist)
<h3>Parameters:</h3>
@ -258,9 +233,34 @@
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component instance
</li>
<li><span class="parameter">points</span>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Callback on scroll to point of interest
</li>
</ul>
</dd>
<dt>
<a name = "set_border"></a>
<strong>set_border(self, border)</strong>
</dt>
<dd>
Set the scroll possibly area
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</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
Component instance
</li>
<li><span class="parameter">border</span>
<span class="types"><span class="type">vmath.vector3</span></span>
Size of scrolling area
</li>
</ul>
@ -276,7 +276,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-02-23 13:01:03 </i>
<i style="float:right;">Last updated 2020-02-23 22:54:59 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -34,15 +34,12 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<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.helper.html">druid.helper</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>
@ -51,7 +48,10 @@
<li><strong>druid.slider</strong></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>
@ -77,7 +77,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-02-23 13:01:03 </i>
<i style="float:right;">Last updated 2020-02-23 22:54:59 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -38,15 +38,12 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<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.helper.html">druid.helper</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>
@ -55,7 +52,10 @@
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><strong>druid.text</strong></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>
@ -74,24 +74,24 @@
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#set_alpha">set_alpha(self, alpha)</a></td>
<td class="summary">Set alpha</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(self, color)</a></td>
<td class="summary">Set color</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_pivot">set_pivot(self, pivot)</a></td>
<td class="summary">Set text pivot.</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(self, scale)</a></td>
<td class="summary">Set scale</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_to">set_to(self, set_to)</a></td>
<td class="summary">Set text to text field</td>
<td class="name" nowrap><a href="#set_pivot">set_pivot(self, pivot)</a></td>
<td class="summary">Set text pivot.</td>
</tr>
</table>
@ -103,11 +103,11 @@
<dl class="function">
<dt>
<a name = "set_alpha"></a>
<strong>set_alpha(self, alpha)</strong>
<a name = "set_to"></a>
<strong>set_to(self, set_to)</strong>
</dt>
<dd>
Set alpha
Set text to text field
<h3>Parameters:</h3>
@ -116,9 +116,9 @@
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component instance
</li>
<li><span class="parameter">alpha</span>
<span class="types"><span class="type">number</span></span>
Alpha for node
<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
</li>
</ul>
@ -153,12 +153,11 @@
</dd>
<dt>
<a name = "set_pivot"></a>
<strong>set_pivot(self, pivot)</strong>
<a name = "set_alpha"></a>
<strong>set_alpha(self, alpha)</strong>
</dt>
<dd>
Set text pivot. Text will re-anchor inside
his text area
Set alpha
<h3>Parameters:</h3>
@ -167,9 +166,9 @@
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component instance
</li>
<li><span class="parameter">pivot</span>
<span class="types"><span class="type">gui.pivot</span></span>
Gui pivot constant
<li><span class="parameter">alpha</span>
<span class="types"><span class="type">number</span></span>
Alpha for node
</li>
</ul>
@ -204,11 +203,12 @@
</dd>
<dt>
<a name = "set_to"></a>
<strong>set_to(self, set_to)</strong>
<a name = "set_pivot"></a>
<strong>set_pivot(self, pivot)</strong>
</dt>
<dd>
Set text to text field
Set text pivot. Text will re-anchor inside
his text area
<h3>Parameters:</h3>
@ -217,9 +217,9 @@
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component instance
</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
<li><span class="parameter">pivot</span>
<span class="types"><span class="type">gui.pivot</span></span>
Gui pivot constant
</li>
</ul>
@ -235,7 +235,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-02-23 13:01:03 </i>
<i style="float:right;">Last updated 2020-02-23 22:54:59 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -38,15 +38,12 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<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.helper.html">druid.helper</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>
@ -55,7 +52,10 @@
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
<li><a href="../modules/druid.text.html">druid.text</a></li>
<li><strong>druid.timer</strong></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>
@ -73,16 +73,16 @@
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#set_interval">set_interval(self, from, to)</a></td>
<td class="summary">Set time interval</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(self, is_on)</a></td>
<td class="summary">Called when update</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_to">set_to(self, set_to)</a></td>
<td class="summary">Set text to text field</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>
@ -94,11 +94,11 @@
<dl class="function">
<dt>
<a name = "set_interval"></a>
<strong>set_interval(self, from, to)</strong>
<a name = "set_to"></a>
<strong>set_to(self, set_to)</strong>
</dt>
<dd>
Set time interval
Set text to text field
<h3>Parameters:</h3>
@ -107,13 +107,9 @@
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component instance
</li>
<li><span class="parameter">from</span>
<li><span class="parameter">set_to</span>
<span class="types"><span class="type">number</span></span>
Start time in seconds
</li>
<li><span class="parameter">to</span>
<span class="types"><span class="type">number</span></span>
Target time in seconds
Value in seconds
</li>
</ul>
@ -148,11 +144,11 @@
</dd>
<dt>
<a name = "set_to"></a>
<strong>set_to(self, set_to)</strong>
<a name = "set_interval"></a>
<strong>set_interval(self, from, to)</strong>
</dt>
<dd>
Set text to text field
Set time interval
<h3>Parameters:</h3>
@ -161,9 +157,13 @@
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
Component instance
</li>
<li><span class="parameter">set_to</span>
<li><span class="parameter">from</span>
<span class="types"><span class="type">number</span></span>
Value in seconds
Start time in seconds
</li>
<li><span class="parameter">to</span>
<span class="types"><span class="type">number</span></span>
Target time in seconds
</li>
</ul>
@ -179,7 +179,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-02-23 13:01:03 </i>
<i style="float:right;">Last updated 2020-02-23 22:54:59 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -30,19 +30,20 @@
<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/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<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.helper.html">druid.helper</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>
@ -51,7 +52,10 @@
<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><strong>druid_event</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>
@ -66,18 +70,99 @@
</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#event:subscribe">event:subscribe(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="summary">Unsubscribe callback on event</td>
</tr>
<tr>
<td class="name" nowrap><a href="#event:trigger">event:trigger(...)</a></td>
<td class="summary">Trigger the event and call all subscribed callbacks</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "event:subscribe"></a>
<strong>event:subscribe(callback)</strong>
</dt>
<dd>
Subscribe callback on event
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Callback itself
</li>
</ul>
</dd>
<dt>
<a name = "event:unsubscribe"></a>
<strong>event:unsubscribe(callback)</strong>
</dt>
<dd>
Unsubscribe callback on event
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
Callback itself
</li>
</ul>
</dd>
<dt>
<a name = "event:trigger"></a>
<strong>event:trigger(...)</strong>
</dt>
<dd>
Trigger the event and call all subscribed callbacks
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
All event params
</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-02-23 13:01:03 </i>
<i style="float:right;">Last updated 2020-02-23 22:54:59 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -38,15 +38,12 @@
<h2>Modules</h2>
<ul class="nowrap">
<li><a href="../modules/component.html">component</a></li>
<li><a href="../modules/druid.html">druid</a></li>
<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.helper.html">druid.helper</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>
@ -55,7 +52,10 @@
<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><strong>druid_instance</strong></li>
</ul>
@ -88,73 +88,21 @@
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<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:initialize">druid:initialize(table, table)</a></td>
<td class="summary">Druid class constructor</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>
<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:new_blocker">druid:new_blocker(...)</a></td>
<td class="summary">Create blocker basic component</td>
<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: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_checkbox">druid:new_checkbox(...)</a></td>
<td class="summary">Create checkbox basic 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 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</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_input">druid:new_input(...)</a></td>
<td class="summary">Create input basic 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 basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_progress">druid:new_progress(...)</a></td>
<td class="summary">Create progress basic 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 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_slider">druid:new_slider(...)</a></td>
<td class="summary">Create slider 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_timer">druid:new_timer(...)</a></td>
<td class="summary">Create timer basic component</td>
<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>
@ -165,12 +113,64 @@
<td class="summary">Druid on_message function</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>
<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:update">druid:update(dt)</a></td>
<td class="summary">Druid update function</td>
<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_lang_text">druid:new_lang_text(...)</a></td>
<td class="summary">Create lang_text basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_timer">druid:new_timer(...)</a></td>
<td class="summary">Create timer basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_progress">druid:new_progress(...)</a></td>
<td class="summary">Create progress 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</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_slider">druid:new_slider(...)</a></td>
<td class="summary">Create slider basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_checkbox">druid:new_checkbox(...)</a></td>
<td class="summary">Create checkbox basic component</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid:new_input">druid:new_input(...)</a></td>
<td class="summary">Create input basic 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 basic 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 basic component</td>
</tr>
</table>
@ -181,31 +181,6 @@
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<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:initialize"></a>
<strong>druid:initialize(table, table)</strong>
@ -232,18 +207,140 @@
</dd>
<dt>
<a name = "druid:new_back_handler"></a>
<strong>druid:new_back_handler(...)</strong>
<a name = "druid:create"></a>
<strong>druid:create(component, ...)</strong>
</dt>
<dd>
Create back_handler basic component
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: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: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>
back_handler init args
button init args
</li>
</ul>
@ -251,7 +348,7 @@
<ol>
<span class="types"><span class="type">Component</span></span>
back_handler component
button component
</ol>
@ -286,18 +383,18 @@
</dd>
<dt>
<a name = "druid:new_button"></a>
<strong>druid:new_button(...)</strong>
<a name = "druid:new_back_handler"></a>
<strong>druid:new_back_handler(...)</strong>
</dt>
<dd>
Create button basic component
Create back_handler basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
button init args
back_handler init args
</li>
</ul>
@ -305,88 +402,7 @@
<ol>
<span class="types"><span class="type">Component</span></span>
button component
</ol>
</dd>
<dt>
<a name = "druid:new_checkbox"></a>
<strong>druid:new_checkbox(...)</strong>
</dt>
<dd>
Create checkbox basic 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_checkbox_group"></a>
<strong>druid:new_checkbox_group(...)</strong>
</dt>
<dd>
Create checkbox_group basic 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_grid"></a>
<strong>druid:new_grid(...)</strong>
</dt>
<dd>
Create 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
back_handler component
</ol>
@ -421,18 +437,18 @@
</dd>
<dt>
<a name = "druid:new_input"></a>
<strong>druid:new_input(...)</strong>
<a name = "druid:new_text"></a>
<strong>druid:new_text(...)</strong>
</dt>
<dd>
Create input basic component
Create text basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
input init args
text init args
</li>
</ul>
@ -440,7 +456,7 @@
<ol>
<span class="types"><span class="type">Component</span></span>
input component
text component
</ol>
@ -473,6 +489,33 @@
</dd>
<dt>
<a name = "druid:new_timer"></a>
<strong>druid:new_timer(...)</strong>
</dt>
<dd>
Create timer basic 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>
@ -502,18 +545,18 @@
</dd>
<dt>
<a name = "druid:new_radio_group"></a>
<strong>druid:new_radio_group(...)</strong>
<a name = "druid:new_grid"></a>
<strong>druid:new_grid(...)</strong>
</dt>
<dd>
Create radio_group basic component
Create grid basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
radio_group init args
grid init args
</li>
</ul>
@ -521,7 +564,7 @@
<ol>
<span class="types"><span class="type">Component</span></span>
radio_group component
grid component
</ol>
@ -583,18 +626,18 @@
</dd>
<dt>
<a name = "druid:new_text"></a>
<strong>druid:new_text(...)</strong>
<a name = "druid:new_checkbox"></a>
<strong>druid:new_checkbox(...)</strong>
</dt>
<dd>
Create text basic component
Create checkbox basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
text init args
checkbox init args
</li>
</ul>
@ -602,7 +645,7 @@
<ol>
<span class="types"><span class="type">Component</span></span>
text component
checkbox component
</ol>
@ -610,18 +653,18 @@
</dd>
<dt>
<a name = "druid:new_timer"></a>
<strong>druid:new_timer(...)</strong>
<a name = "druid:new_input"></a>
<strong>druid:new_input(...)</strong>
</dt>
<dd>
Create timer basic component
Create input basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
timer init args
input init args
</li>
</ul>
@ -629,7 +672,7 @@
<ol>
<span class="types"><span class="type">Component</span></span>
timer component
input component
</ol>
@ -637,97 +680,54 @@
</dd>
<dt>
<a name = "druid:on_input"></a>
<strong>druid:on_input(action_id, action)</strong>
<a name = "druid:new_checkbox_group"></a>
<strong>druid:new_checkbox_group(...)</strong>
</dt>
<dd>
Druid on_input function
Create checkbox_group basic component
<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><span class="parameter">...</span>
<span class="types"><span class="type">args</span></span>
checkbox_group init args
</li>
</ul>
<h3>Returns:</h3>
<ol>
</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: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>
checkbox_group component
</ol>
</dd>
<dt>
<a name = "druid:update"></a>
<strong>druid:update(dt)</strong>
<a name = "druid:new_radio_group"></a>
<strong>druid:new_radio_group(...)</strong>
</dt>
<dd>
Druid update function
Create radio_group basic component
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">dt</span>
<span class="types"><span class="type">number</span></span>
Delta time
<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>
@ -740,7 +740,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-02-23 13:01:03 </i>
<i style="float:right;">Last updated 2020-02-23 22:54:59 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>

View File

@ -2,15 +2,27 @@
-- @module druid.button
--- Component events
-- @tfield druid_event on_click
-- @tfield druid_event on_hold_click
-- @tfield druid_event on_long_click
-- @tfield druid_event on_double_click
-- @table events
-- @table Events
-- @tfield druid_event on_click On release button callback
-- @tfield druid_event on_repeated_click On repeated action button callback
-- @tfield druid_event on_long_click On long tap button callback
-- @tfield druid_event on_double_click On double tap button callback
--- Component fields
-- @tfield node Main node
-- @table fields
-- @table Fields
-- @tfield node node Trigger node
-- @tfield[opt=node] node anim_node Animation node
-- @tfield vector3 scale_from Initial scale of anim_node
-- @tfield vector3 pos Initial pos of anim_node
-- @tfield any params Params to click callbacks
-- @tfield boolean hover_anim Is hover anim enabled
-- @tfield druid.hover hover Druid hover logic component
-- @tfield[opt] node click_zone Restriction zone
--- Component style params
-- @table Style
-- @tfield function on_click (self, node)
-- @tfield function on_hover (self, node, hover_state)
local Event = require("druid.event")
local const = require("druid.const")
@ -36,7 +48,7 @@ local function on_button_release(self)
if self.style.on_click then
self.style.on_click(self, self.anim_node)
end
self.callback(self:get_context(), self.params, self)
self.on_click:trigger(self:get_context(), self.params, self)
end
return true
else
@ -66,19 +78,21 @@ function M.init(self, node, callback, params, anim_node, event)
self.anim_node = anim_node and helper:get_node(anim_node) or self.node
-- TODO: rename to start_scale
self.scale_from = gui.get_scale(self.anim_node)
self.pos = gui.get_position(self.anim_node)
self.callback = callback
self.params = params
self.hover_anim = self.style.IS_HOVER
self.hover = self.druid:new_hover(node, self, on_button_hover)
self.click_zone = nil
-- Event stubs
self.on_click = Event()
self.on_hold_click = Event()
self.on_repeated_click = Event()
self.on_long_click = Event()
self.on_double_click = Event()
self.click_zone = nil
if callback then
self.on_click:subscribe(callback)
end
end
@ -166,28 +180,4 @@ function M.get_key_trigger(self)
end
--- Set usual button callback
function M.set_callback(self, callback)
end
--- Repeat callback always, while holding button
function M.set_hold_callback(self, callback)
end
--- Get doubletap callback on this button
function M.set_double_tap_callback(self, callback)
end
--- Single callbacka after long_tap. No usual callback invoked
function M.set_long_tap_callback(self, callback)
end
return M

View File

@ -9,26 +9,6 @@ local class = require("druid.system.middleclass")
local Component = class("druid.component")
--- Setup component context and his style table
-- @function component:setup_component
-- @tparam context table Druid context. Usually it is self of script
-- @tparam style table Druid style module
-- @treturn Component Component itself
function Component.setup_component(self, context, style)
self._meta = {
template = nil,
context = nil,
nodes = nil,
style = nil,
}
self:set_context(context)
self:set_style(style)
return self
end
--- Get current component style table
-- @function component:get_style
-- @treturn table Component style table
@ -136,6 +116,26 @@ function Component.get_druid(self)
end
--- Setup component context and his style table
-- @function component:setup_component
-- @tparam context table Druid context. Usually it is self of script
-- @tparam style table Druid style module
-- @treturn Component Component itself
function Component.setup_component(self, context, style)
self._meta = {
template = nil,
context = nil,
nodes = nil,
style = nil,
}
self:set_context(context)
self:set_style(style)
return self
end
--- Basic constructor of component. It will call automaticaly
-- by `Component.static.create`
-- @function component:initialize

View File

@ -12,13 +12,20 @@ function M.initialize(self)
end
--- Subscribe callback on event
-- @function event:subscribe
-- @tparam function callback Callback itself
function M.subscribe(self, callback)
assert(type(self) == "table", "You should subscribe to event with : syntax")
assert(type(callback) == "function", "Callback should be function")
table.insert(self._callbacks, callback)
end
--- Unsubscribe callback on event
-- @function event:unsubscribe
-- @tparam function callback Callback itself
function M.unsubscribe(self, callback)
for i = 1, #self._callbacks do
if self._callbacks[i] == callback then
@ -29,6 +36,9 @@ function M.unsubscribe(self, callback)
end
--- Trigger the event and call all subscribed callbacks
-- @function event:trigger
-- @param ... All event params
function M.trigger(self, ...)
for i = 1, #self._callbacks do
self._callbacks[i](...)