mirror of
https://github.com/Insality/druid
synced 2025-06-27 10:27:48 +02:00
Update docs
This commit is contained in:
parent
0539746519
commit
2cfc6e477e
@ -185,7 +185,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -440,7 +440,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -215,7 +215,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -234,7 +234,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -404,7 +404,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -277,7 +277,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -239,7 +239,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -370,7 +370,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -236,7 +236,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -211,7 +211,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -181,7 +181,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -86,7 +86,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -240,7 +240,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -379,7 +379,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -239,7 +239,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -507,7 +507,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -278,7 +278,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -352,7 +352,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -293,7 +293,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -239,7 +239,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -769,7 +769,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -124,7 +124,8 @@ Where node name is name of node from GUI scene. You can use <code>node_name</cod
|
|||||||
- **on_double_click** - different callback, if tap button 2+ in row, don'</span>t trigger <span class="keyword">if</span> callback is empty
|
- **on_double_click** - different callback, if tap button 2+ in row, don'</span>t trigger <span class="keyword">if</span> callback is empty
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>- If you have stencil on buttons and you don't want trigger them outside of stencil node, you can use <a href="../modules/druid.button.html#set_click_zone">button:set_click_zone</a> to restrict button click zone
|
<p>- If button have double click event and it is triggered, usual callback will be not invoked
|
||||||
|
- If you have stencil on buttons and you don't want trigger them outside of stencil node, you can use <a href="../modules/druid.button.html#set_click_zone">button:set_click_zone</a> to restrict button click zone
|
||||||
- Button can have key trigger to use then by key: <a href="../modules/druid.button.html#set_key_trigger">button:set_key_trigger</a>
|
- Button can have key trigger to use then by key: <a href="../modules/druid.button.html#set_key_trigger">button:set_key_trigger</a>
|
||||||
- Animation node can be used for example to animate small icon on big panel. Node name of trigger zone will be <code>big panel</code> and animation node will be <code>small icon</code></p>
|
- Animation node can be used for example to animate small icon on big panel. Node name of trigger zone will be <code>big panel</code> and animation node will be <code>small icon</code></p>
|
||||||
|
|
||||||
@ -137,7 +138,7 @@ Where node name is name of node from GUI scene. You can use <code>node_name</cod
|
|||||||
<p>Basic Druid text component. Text components by default have the text size adjusting.</p>
|
<p>Basic Druid text component. Text components by default have the text size adjusting.</p>
|
||||||
|
|
||||||
<h3>Setup</h3>
|
<h3>Setup</h3>
|
||||||
<p>Create text node with druid: <code>text = druid:new_text(node_name, [initial_value])</code></p>
|
<p>Create text node with druid: <code>text = druid:new_text(node_name, [initial_value], [is_disable_size_adjust])</code></p>
|
||||||
|
|
||||||
<h3>Notes</h3>
|
<h3>Notes</h3>
|
||||||
<p>- Text component by default have auto adjust text sizing. Text never will be bigger, than text node size, which you can setup in GUI scene. It can be disabled on component creating by settings argument <code>is_no_adjust</code> to <em>true</em></p>
|
<p>- Text component by default have auto adjust text sizing. Text never will be bigger, than text node size, which you can setup in GUI scene. It can be disabled on component creating by settings argument <code>is_no_adjust</code> to <em>true</em></p>
|
||||||
@ -373,7 +374,7 @@ Key is value from druid const: const.SIDE.X (or just "x") or const.SIDE.Y (or ju
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -82,7 +82,9 @@
|
|||||||
<p><a name="Overview"></a></p>
|
<p><a name="Overview"></a></p>
|
||||||
<h2>Overview</h2>
|
<h2>Overview</h2>
|
||||||
|
|
||||||
<p>Druid allows you to create your custom components from druid basic components or other custom components</p>
|
<p>Druid allows you to create your custom components from druid basic components or other custom components.</p>
|
||||||
|
|
||||||
|
<p>Every component is the children of Basic Druid component. Read the [basic component API here].(https://insality.github.io/druid/modules/component.html), Methods of basic components you can call via self:{method_name}</p>
|
||||||
|
|
||||||
|
|
||||||
<p><a name="Custom_components"></a></p>
|
<p><a name="Custom_components"></a></p>
|
||||||
@ -94,7 +96,7 @@
|
|||||||
<span class="keyword">local</span> const = <span class="global">require</span>(<span class="string">"druid.const"</span>)
|
<span class="keyword">local</span> const = <span class="global">require</span>(<span class="string">"druid.const"</span>)
|
||||||
<span class="keyword">local</span> component = <span class="global">require</span>(<span class="string">"druid.component"</span>)
|
<span class="keyword">local</span> component = <span class="global">require</span>(<span class="string">"druid.component"</span>)
|
||||||
|
|
||||||
<span class="keyword">local</span> M = component.create(<span class="string">"name_your_component"</span>)
|
<span class="keyword">local</span> M = component.create(<span class="string">"my_component"</span>)
|
||||||
|
|
||||||
<span class="comment">-- Component constructor
|
<span class="comment">-- Component constructor
|
||||||
</span><span class="keyword">function</span> M.init(self, ...)
|
</span><span class="keyword">function</span> M.init(self, ...)
|
||||||
@ -146,16 +148,22 @@
|
|||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|
||||||
<p>Registering make new function with "new<em>{component</em>name}". In our example it will be: <code>druid:new_my_component()</code></p>
|
<p>Registering make new function with "new<em>{component</em>name}". In our example it will be: <code>druid:new_my_component()</code>.</p>
|
||||||
|
|
||||||
|
<p>Or you can create component without registering with <code>druid:create(my_component_module)</code></p>
|
||||||
|
|
||||||
<p>As component registered, you can create your component with next code:</p>
|
<p>As component registered, you can create your component with next code:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
|
<span class="keyword">local</span> druid = <span class="global">require</span>(<span class="string">"druid.druid"</span>)
|
||||||
|
<span class="keyword">local</span> my_component = <span class="global">require</span>(<span class="string">"my.amazing.component"</span>)
|
||||||
|
|
||||||
<span class="keyword">function</span> init(self)
|
<span class="keyword">function</span> init(self)
|
||||||
self.druid = druid.new(self)
|
self.druid = druid.new(self)
|
||||||
|
|
||||||
<span class="keyword">local</span> my_component = self.druid:new_my_component(...)
|
<span class="keyword">local</span> my_component = self.druid:new_my_component(...)
|
||||||
|
<span class="comment">-- or --
|
||||||
|
</span> <span class="keyword">local</span> my_component = self.druid:create(my_component, ...)
|
||||||
<span class="keyword">end</span>
|
<span class="keyword">end</span>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
@ -225,7 +233,7 @@ There is next interests in druid:
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -138,7 +138,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -89,7 +89,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -87,7 +87,7 @@
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -41,7 +41,6 @@
|
|||||||
<li><a href="#Examples">Examples </a></li>
|
<li><a href="#Examples">Examples </a></li>
|
||||||
<li><a href="#Documentation">Documentation </a></li>
|
<li><a href="#Documentation">Documentation </a></li>
|
||||||
<li><a href="#Games_powered_by_Druid">Games powered by Druid </a></li>
|
<li><a href="#Games_powered_by_Druid">Games powered by Druid </a></li>
|
||||||
<li><a href="#Future_plans">Future plans </a></li>
|
|
||||||
<li><a href="#License">License </a></li>
|
<li><a href="#License">License </a></li>
|
||||||
<li><a href="#Issues_and_suggestions">Issues and suggestions </a></li>
|
<li><a href="#Issues_and_suggestions">Issues and suggestions </a></li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -156,19 +155,19 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li><p><strong><a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md#button">Button</a></strong> - Basic Druid input component</p></li>
|
<li><p><strong><a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md#button">Button</a></strong> - Basic Druid input component</p></li>
|
||||||
<li><p><strong><a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md#text">Text</a></strong> - Basic Druid text component</p></li>
|
<li><p><strong><a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md#text">Text</a></strong> - Basic Druid text component</p></li>
|
||||||
<li><p><strong>Lang text</strong> - Wrap on Text component to handle localization</p></li>
|
<li><p><strong><a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md#lang-text">Lang text</a></strong> - Wrap on Text component to handle localization</p></li>
|
||||||
<li><p><strong>Scroll</strong> - Basic Druid scroll component</p></li>
|
<li><p><strong><a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md#scroll">Scroll</a></strong> - Basic Druid scroll component</p></li>
|
||||||
<li><p><strong>Progress</strong> - Basic Druid progress bar component</p></li>
|
<li><p><strong><a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md#progress">Progress</a></strong> - Basic Druid progress bar component</p></li>
|
||||||
<li><p><strong>Slider</strong> - Basic Druid slider component</p></li>
|
<li><p><strong><a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md#slider">Slider</a></strong> - Basic Druid slider component</p></li>
|
||||||
<li><p><strong>Input</strong> - Basic Druid text input component (unimplemented)</p></li>
|
<li><p><strong><a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md#input">Input</a></strong> - Basic Druid text input component (unimplemented)</p></li>
|
||||||
<li><p><strong>Checkbox</strong> - Basic Druid checkbox component</p></li>
|
<li><p><strong><a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md#checkbox">Checkbox</a></strong> - Basic Druid checkbox component</p></li>
|
||||||
<li><p><strong>Checkbox group</strong> - Several checkboxes in one group</p></li>
|
<li><p><strong><a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md#checkbox-group">Checkbox group</a></strong> - Several checkboxes in one group</p></li>
|
||||||
<li><p><strong>Radio group</strong> - Several checkboxes in one group with single choice</p></li>
|
<li><p><strong><a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md#radio-group">Radio group</a></strong> - Several checkboxes in one group with single choice</p></li>
|
||||||
<li><p><strong><a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md#blocker">Blocker</a></strong> - Block input in node zone component</p></li>
|
<li><p><strong><a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md#blocker">Blocker</a></strong> - Block input in node zone component</p></li>
|
||||||
<li><p><strong>Back Handler</strong> - Handle back button (Android back, backspace)</p></li>
|
<li><p><strong><a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md#back-handler">Back Handler</a></strong> - Handle back button (Android back, backspace)</p></li>
|
||||||
<li><p><strong>Timer</strong> - Handle timer work on gui text node</p></li>
|
<li><p><strong><a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md#timer">Timer</a></strong> - Handle timer work on gui text node</p></li>
|
||||||
<li><p><strong>Grid</strong> - Component for manage node positions </p></li>
|
<li><p><strong><a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md#grid">Grid</a></strong> - Component for manage node positions </p></li>
|
||||||
<li><p><strong>Hover</strong> - System Druid component, handle hover node state</p></li>
|
<li><p><strong><a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md#hover">Hover</a></strong> - System Druid component, handle hover node state</p></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>Full info see on <em><a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md">components.md</a></em></p>
|
<p>Full info see on <em><a href="https://github.com/Insality/druid/blob/master/docs_md/01-components.md">components.md</a></em></p>
|
||||||
@ -294,19 +293,6 @@ https://insality.github.io/druid/</p>
|
|||||||
<p><em>Will fill later</em></p>
|
<p><em>Will fill later</em></p>
|
||||||
|
|
||||||
|
|
||||||
<p><a name="Future_plans"></a></p>
|
|
||||||
<h2>Future plans</h2>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li><p>Basic input component</p></li>
|
|
||||||
<li><p>Add on<em>layout</em>change support (to keep gui data between layout change)</p></li>
|
|
||||||
<li><p>Add on<em>change</em>language support (call single function to update all Druid instance)</p></li>
|
|
||||||
<li><p>Unit tests</p></li>
|
|
||||||
<li><p>Better documentation and examples</p></li>
|
|
||||||
<li><p>Add more comfortable gamepad support for GUI (ability to select button with DPAD and other stuff)</p></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
|
|
||||||
<p><a name="License"></a></p>
|
<p><a name="License"></a></p>
|
||||||
<h2>License</h2>
|
<h2>License</h2>
|
||||||
|
|
||||||
@ -328,7 +314,7 @@ https://insality.github.io/druid/</p>
|
|||||||
</div> <!-- id="main" -->
|
</div> <!-- id="main" -->
|
||||||
<div id="about">
|
<div id="about">
|
||||||
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
||||||
<i style="float:right;">Last updated 2020-04-09 22:11:32 </i>
|
<i style="float:right;">Last updated 2020-04-13 19:36:00 </i>
|
||||||
</div> <!-- id="about" -->
|
</div> <!-- id="about" -->
|
||||||
</div> <!-- id="container" -->
|
</div> <!-- id="container" -->
|
||||||
</body>
|
</body>
|
||||||
|
@ -25,6 +25,7 @@ Where node name is name of node from GUI scene. You can use `node_name` as input
|
|||||||
- **on_long_click** - callback on long button tap, don't trigger if callback is empty
|
- **on_long_click** - callback on long button tap, don't trigger if callback is empty
|
||||||
- **on_hold_click** - hold callback, before long_click trigger, don't trigger if callback is empty
|
- **on_hold_click** - hold callback, before long_click trigger, don't trigger if callback is empty
|
||||||
- **on_double_click** - different callback, if tap button 2+ in row, don't trigger if callback is empty
|
- **on_double_click** - different callback, if tap button 2+ in row, don't trigger if callback is empty
|
||||||
|
- If button have double click event and it is triggered, usual callback will be not invoked
|
||||||
- If you have stencil on buttons and you don't want trigger them outside of stencil node, you can use `button:set_click_zone` to restrict button click zone
|
- If you have stencil on buttons and you don't want trigger them outside of stencil node, you can use `button:set_click_zone` to restrict button click zone
|
||||||
- Button can have key trigger to use then by key: `button:set_key_trigger`
|
- Button can have key trigger to use then by key: `button:set_key_trigger`
|
||||||
- Animation node can be used for example to animate small icon on big panel. Node name of trigger zone will be `big panel` and animation node will be `small icon`
|
- Animation node can be used for example to animate small icon on big panel. Node name of trigger zone will be `big panel` and animation node will be `small icon`
|
||||||
@ -37,7 +38,7 @@ Where node name is name of node from GUI scene. You can use `node_name` as input
|
|||||||
Basic Druid text component. Text components by default have the text size adjusting.
|
Basic Druid text component. Text components by default have the text size adjusting.
|
||||||
|
|
||||||
### Setup
|
### Setup
|
||||||
Create text node with druid: `text = druid:new_text(node_name, [initial_value])`
|
Create text node with druid: `text = druid:new_text(node_name, [initial_value], [is_disable_size_adjust])`
|
||||||
|
|
||||||
### Notes
|
### Notes
|
||||||
- Text component by default have auto adjust text sizing. Text never will be bigger, than text node size, which you can setup in GUI scene. It can be disabled on component creating by settings argument `is_no_adjust` to _true_
|
- Text component by default have auto adjust text sizing. Text never will be bigger, than text node size, which you can setup in GUI scene. It can be disabled on component creating by settings argument `is_no_adjust` to _true_
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
Druid allows you to create your custom components from druid basic components or other custom components. Read the [basic component API here].(https://insality.github.io/druid/modules/component.html)
|
Druid allows you to create your custom components from druid basic components or other custom components.
|
||||||
|
|
||||||
|
Every component is the children of Basic Druid component. Read the [basic component API here].(https://insality.github.io/druid/modules/component.html), Methods of basic components you can call via self:{method_name}
|
||||||
|
|
||||||
|
|
||||||
## Custom components
|
## Custom components
|
||||||
@ -12,7 +14,7 @@ Basic custom component template looks like this:
|
|||||||
local const = require("druid.const")
|
local const = require("druid.const")
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
|
|
||||||
local M = component.create("name_your_component")
|
local M = component.create("my_component")
|
||||||
|
|
||||||
-- Component constructor
|
-- Component constructor
|
||||||
function M.init(self, ...)
|
function M.init(self, ...)
|
||||||
@ -61,15 +63,21 @@ function init(self)
|
|||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
Registering make new function with "new_{component_name}". In our example it will be: `druid:new_my_component()`
|
Registering make new function with "new_{component_name}". In our example it will be: `druid:new_my_component()`.
|
||||||
|
|
||||||
|
Or you can create component without registering with `druid:create(my_component_module)`
|
||||||
|
|
||||||
As component registered, you can create your component with next code:
|
As component registered, you can create your component with next code:
|
||||||
```lua
|
```lua
|
||||||
local druid = require("druid.druid")
|
local druid = require("druid.druid")
|
||||||
|
local my_component = require("my.amazing.component")
|
||||||
|
|
||||||
function init(self)
|
function init(self)
|
||||||
self.druid = druid.new(self)
|
self.druid = druid.new(self)
|
||||||
|
|
||||||
local my_component = self.druid:new_my_component(...)
|
local my_component = self.druid:new_my_component(...)
|
||||||
|
-- or --
|
||||||
|
local my_component = self.druid:create(my_component, ...)
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user