Update docs

This commit is contained in:
Insality 2024-08-27 17:16:33 +03:00
parent 731e5f6627
commit 7f90ae99e6
9 changed files with 148 additions and 22 deletions

View File

@ -147,9 +147,8 @@ local back_handler = self.druid:new_back_handler(callback, [params])
<ul> <ul>
<li><span class="parameter">params</span> <li><span class="parameter">params</span>
<span class="types"><span class="type">any</span></span> <span class="types"><span class="type">any</span> or <span class="type">nil</span></span>
(<em>optional</em>)
</li> </li>
</ul> </ul>

View File

@ -97,7 +97,7 @@
print(&quot;Also the button component is passed in callback params&quot;) print(&quot;Also the button component is passed in callback params&quot;)
end end
local custom_args = &quot;any variable to pass inside callback&quot; local custom_args = &quot;Any variable to pass inside callback&quot;
local button = self.druid:new_button(&quot;button_name&quot;, on_button_click, custom_args) local button = self.druid:new_button(&quot;button_name&quot;, on_button_click, custom_args)
</pre> </pre>
</ul> </ul>
@ -153,7 +153,7 @@ local button = self.druid:new_button(&quot;button_name&quot;, on_button_click, c
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#click_zone">click_zone</a></td> <td class="name" nowrap><a href="#click_zone">click_zone</a></td>
<td class="summary">Additional button click area, defined by another GUI Node</td> <td class="summary">Additional button click area, defined by another GUI node</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#hover">hover</a></td> <td class="name" nowrap><a href="#hover">hover</a></td>
@ -433,7 +433,7 @@ button:set_enabled(<span class="keyword">true</span>)</pre>
<a href="../modules/Button.html#">Button</a> <a href="../modules/Button.html#">Button</a>
</li> </li>
<li><span class="parameter">key</span> <li><span class="parameter">key</span>
<span class="types"><span class="type">hash</span></span> <span class="types"><span class="type">hash</span> or <a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
The action_id of the input key The action_id of the input key
</li> </li>
</ul> </ul>
@ -581,14 +581,13 @@ button:set_enabled(<span class="keyword">true</span>)</pre>
<strong>click_zone</strong> <strong>click_zone</strong>
</dt> </dt>
<dd> <dd>
Additional button click area, defined by another GUI Node Additional button click area, defined by another GUI node
<ul> <ul>
<li><span class="parameter">click_zone</span> <li><span class="parameter">click_zone</span>
<span class="types"><a class="type" href="../modules/Button.html#node">node</a></span> <span class="types"><a class="type" href="../modules/Button.html#node">node</a> or <span class="type">nil</span></span>
(<em>optional</em>)
</li> </li>
</ul> </ul>

View File

@ -129,6 +129,10 @@
<td class="summary">Is component now touching</td> <td class="summary">Is component now touching</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#node">node</a></td>
<td class="summary">Drag node</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_drag">on_drag</a></td> <td class="name" nowrap><a href="#on_drag">on_drag</a></td>
<td class="summary">on drag progress callback(self, dx, dy, total_x, total_y)</td> <td class="summary">on drag progress callback(self, dx, dy, total_x, total_y)</td>
</tr> </tr>
@ -138,7 +142,7 @@
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#on_drag_start">on_drag_start</a></td> <td class="name" nowrap><a href="#on_drag_start">on_drag_start</a></td>
<td class="summary">Event on drag start callback(self)</td> <td class="summary">Event on drag start callback(self, touch)</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#on_touch_end">on_touch_end</a></td> <td class="name" nowrap><a href="#on_touch_end">on_touch_end</a></td>
@ -149,6 +153,14 @@
<td class="summary">Event on touch start callback(self)</td> <td class="summary">Event on touch start callback(self)</td>
</tr> </tr>
<tr> <tr>
<td class="name" nowrap><a href="#screen_x">screen_x</a></td>
<td class="summary">Current touch x screen position</td>
</tr>
<tr>
<td class="name" nowrap><a href="#screen_y">screen_y</a></td>
<td class="summary">Current touch y screen position</td>
</tr>
<tr>
<td class="name" nowrap><a href="#touch_start_pos">touch_start_pos</a></td> <td class="name" nowrap><a href="#touch_start_pos">touch_start_pos</a></td>
<td class="summary">Touch start position</td> <td class="summary">Touch start position</td>
</tr> </tr>
@ -184,7 +196,7 @@
<a href="../modules/Drag.html#">Drag</a> <a href="../modules/Drag.html#">Drag</a>
</li> </li>
<li><span class="parameter">node</span> <li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span> <span class="types"><a class="type" href="../modules/Drag.html#node">node</a></span>
GUI node to detect dragging GUI node to detect dragging
</li> </li>
<li><span class="parameter">on_drag_callback</span> <li><span class="parameter">on_drag_callback</span>
@ -241,7 +253,7 @@
<a href="../modules/Drag.html#">Drag</a> <a href="../modules/Drag.html#">Drag</a>
</li> </li>
<li><span class="parameter">node</span> <li><span class="parameter">node</span>
<span class="types"><span class="type">node</span></span> <span class="types"><a class="type" href="../modules/Drag.html#node">node</a></span>
Gui node Gui node
</li> </li>
</ul> </ul>
@ -392,6 +404,26 @@
</dd>
<dt>
<a name = "node"></a>
<strong>node</strong>
</dt>
<dd>
Drag node
<ul>
<li><span class="parameter">node</span>
<span class="types"><a class="type" href="../modules/Drag.html#node">node</a></span>
</li>
</ul>
</dd> </dd>
<dt> <dt>
<a name = "on_drag"></a> <a name = "on_drag"></a>
@ -438,7 +470,7 @@
<strong>on_drag_start</strong> <strong>on_drag_start</strong>
</dt> </dt>
<dd> <dd>
Event on drag start callback(self) Event on drag start callback(self, touch)
<ul> <ul>
@ -492,6 +524,46 @@
</dd>
<dt>
<a name = "screen_x"></a>
<strong>screen_x</strong>
</dt>
<dd>
Current touch x screen position
<ul>
<li><span class="parameter">screen_x</span>
<span class="types"><span class="type">number</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "screen_y"></a>
<strong>screen_y</strong>
</dt>
<dd>
Current touch y screen position
<ul>
<li><span class="parameter">screen_y</span>
<span class="types"><span class="type">number</span></span>
</li>
</ul>
</dd> </dd>
<dt> <dt>
<a name = "touch_start_pos"></a> <a name = "touch_start_pos"></a>

View File

@ -1211,7 +1211,7 @@ end
Message from on_message Message from on_message
</li> </li>
<li><span class="parameter">sender</span> <li><span class="parameter">sender</span>
<span class="types"><span class="type">hash</span></span> <span class="types"><span class="type">url</span></span>
Sender from on_message Sender from on_message
</li> </li>
</ul> </ul>

View File

@ -90,6 +90,10 @@
<td class="name" nowrap><a href="#init">init(self, keys, callback, callback_argument)</a></td> <td class="name" nowrap><a href="#init">init(self, keys, callback, callback_argument)</a></td>
<td class="summary">The <a href="../modules/Hotkey.html#">Hotkey</a> constructor</td> <td class="summary">The <a href="../modules/Hotkey.html#">Hotkey</a> constructor</td>
</tr> </tr>
<tr>
<td class="name" nowrap><a href="#set_repeat">set_repeat(self, is_enabled_repeated)</a></td>
<td class="summary">If true, the callback will be triggered on action.repeated</td>
</tr>
</table> </table>
<h2><a href="#Tables">Tables</a></h2> <h2><a href="#Tables">Tables</a></h2>
<table class="function_list"> <table class="function_list">
@ -192,6 +196,37 @@
</dd>
<dt>
<a name = "set_repeat"></a>
<strong>set_repeat(self, is_enabled_repeated)</strong>
</dt>
<dd>
If true, the callback will be triggered on action.repeated
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">Hotkey</span></span>
<a href="../modules/Hotkey.html#">Hotkey</a>
</li>
<li><span class="parameter">is_enabled_repeated</span>
<span class="types"><span class="type">bool</span></span>
The flag value
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Hotkey</span></span>
</ol>
</dd> </dd>
</dl> </dl>
<h2 class="section-header "><a name="Tables"></a>Tables</h2> <h2 class="section-header "><a name="Tables"></a>Tables</h2>

View File

@ -477,9 +477,8 @@
<ul> <ul>
<li><span class="parameter">allowerd_characters</span> <li><span class="parameter">allowerd_characters</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span> <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <span class="type">nil</span></span>
(<em>optional</em>)
</li> </li>
</ul> </ul>
@ -578,9 +577,8 @@
<ul> <ul>
<li><span class="parameter">max_length</span> <li><span class="parameter">max_length</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
(<em>optional</em>)
</li> </li>
</ul> </ul>

View File

@ -177,6 +177,10 @@
</table> </table>
<h2><a href="#Fields">Fields</a></h2> <h2><a href="#Fields">Fields</a></h2>
<table class="function_list"> <table class="function_list">
<tr>
<td class="name" nowrap><a href="#_is_inert">_is_inert</a></td>
<td class="summary">Flag, if scroll now moving by inertion</td>
</tr>
<tr> <tr>
<td class="name" nowrap><a href="#available_pos">available_pos</a></td> <td class="name" nowrap><a href="#available_pos">available_pos</a></td>
<td class="summary">Available position for content node: (min_x, max_y, max_x, min_y)</td> <td class="summary">Available position for content node: (min_x, max_y, max_x, min_y)</td>
@ -817,6 +821,26 @@
<h2 class="section-header "><a name="Fields"></a>Fields</h2> <h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function"> <dl class="function">
<dt>
<a name = "_is_inert"></a>
<strong>_is_inert</strong>
</dt>
<dd>
Flag, if scroll now moving by inertion
<ul>
<li><span class="parameter">_is_inert</span>
<span class="types"><span class="type">bool</span></span>
</li>
</ul>
</dd>
<dt> <dt>
<a name = "available_pos"></a> <a name = "available_pos"></a>
<strong>available_pos</strong> <strong>available_pos</strong>
@ -1027,9 +1051,8 @@
<ul> <ul>
<li><span class="parameter">selected</span> <li><span class="parameter">selected</span>
<span class="types"><span class="type">number</span></span> <span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
(<em>optional</em>)
</li> </li>
</ul> </ul>

View File

@ -544,7 +544,7 @@
<a href="../modules/Text.html#">Text</a> <a href="../modules/Text.html#">Text</a>
</li> </li>
<li><span class="parameter">adjust_type</span> <li><span class="parameter">adjust_type</span>
<span class="types"><span class="type">number</span> or <span class="type">nil</span></span> <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <span class="type">nil</span></span>
See const.TEXT_ADJUST. If pass nil - use current adjust type See const.TEXT_ADJUST. If pass nil - use current adjust type
</li> </li>
<li><span class="parameter">minimal_scale</span> <li><span class="parameter">minimal_scale</span>

View File

@ -390,12 +390,12 @@ function druid__data_list.set_data(self, data) end
---@field on_drag_start druid.event Event on drag start callback(self, touch) ---@field on_drag_start druid.event Event on drag start callback(self, touch)
---@field on_touch_end druid.event Event on touch end callback(self) ---@field on_touch_end druid.event Event on touch end callback(self)
---@field on_touch_start druid.event Event on touch start callback(self) ---@field on_touch_start druid.event Event on touch start callback(self)
---@field screen_x number Current touch x screen position
---@field screen_y number Current touch y screen position
---@field style druid.drag.style Component style params. ---@field style druid.drag.style Component style params.
---@field touch_start_pos vector3 Touch start position ---@field touch_start_pos vector3 Touch start position
---@field x number Current touch x position ---@field x number Current touch x position
---@field y number Current touch y position ---@field y number Current touch y position
---@field screen_x number Current touch x screen position
---@field screen_y number Current touch y screen position
local druid__drag = {} local druid__drag = {}
--- The @{Drag} constructor --- The @{Drag} constructor