mirror of
https://github.com/Insality/druid
synced 2025-06-27 10:27:48 +02:00
Update docs
This commit is contained in:
parent
731e5f6627
commit
7f90ae99e6
@ -147,9 +147,8 @@ local back_handler = self.druid:new_back_handler(callback, [params])
|
||||
|
||||
<ul>
|
||||
<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>
|
||||
</ul>
|
||||
|
||||
|
@ -97,7 +97,7 @@
|
||||
print("Also the button component is passed in callback params")
|
||||
end
|
||||
|
||||
local custom_args = "any variable to pass inside callback"
|
||||
local custom_args = "Any variable to pass inside callback"
|
||||
local button = self.druid:new_button("button_name", on_button_click, custom_args)
|
||||
</pre>
|
||||
</ul>
|
||||
@ -153,7 +153,7 @@ local button = self.druid:new_button("button_name", on_button_click, c
|
||||
</tr>
|
||||
<tr>
|
||||
<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>
|
||||
<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>
|
||||
</li>
|
||||
<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
|
||||
</li>
|
||||
</ul>
|
||||
@ -581,14 +581,13 @@ button:set_enabled(<span class="keyword">true</span>)</pre>
|
||||
<strong>click_zone</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Additional button click area, defined by another GUI Node
|
||||
Additional button click area, defined by another GUI node
|
||||
|
||||
|
||||
<ul>
|
||||
<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>
|
||||
</ul>
|
||||
|
||||
|
@ -129,6 +129,10 @@
|
||||
<td class="summary">Is component now touching</td>
|
||||
</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="summary">on drag progress callback(self, dx, dy, total_x, total_y)</td>
|
||||
</tr>
|
||||
@ -138,7 +142,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#on_drag_start">on_drag_start</a></td>
|
||||
<td class="summary">Event on drag start callback(self)</td>
|
||||
<td class="summary">Event on drag start callback(self, touch)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<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>
|
||||
</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="summary">Touch start position</td>
|
||||
</tr>
|
||||
@ -184,7 +196,7 @@
|
||||
<a href="../modules/Drag.html#">Drag</a>
|
||||
</li>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
<span class="types"><a class="type" href="../modules/Drag.html#node">node</a></span>
|
||||
GUI node to detect dragging
|
||||
</li>
|
||||
<li><span class="parameter">on_drag_callback</span>
|
||||
@ -241,7 +253,7 @@
|
||||
<a href="../modules/Drag.html#">Drag</a>
|
||||
</li>
|
||||
<li><span class="parameter">node</span>
|
||||
<span class="types"><span class="type">node</span></span>
|
||||
<span class="types"><a class="type" href="../modules/Drag.html#node">node</a></span>
|
||||
Gui node
|
||||
</li>
|
||||
</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>
|
||||
<dt>
|
||||
<a name = "on_drag"></a>
|
||||
@ -438,7 +470,7 @@
|
||||
<strong>on_drag_start</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Event on drag start callback(self)
|
||||
Event on drag start callback(self, touch)
|
||||
|
||||
|
||||
<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>
|
||||
<dt>
|
||||
<a name = "touch_start_pos"></a>
|
||||
|
@ -1211,7 +1211,7 @@ end
|
||||
Message from on_message
|
||||
</li>
|
||||
<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
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -90,6 +90,10 @@
|
||||
<td class="name" nowrap><a href="#init">init(self, keys, callback, callback_argument)</a></td>
|
||||
<td class="summary">The <a href="../modules/Hotkey.html#">Hotkey</a> constructor</td>
|
||||
</tr>
|
||||
<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>
|
||||
<h2><a href="#Tables">Tables</a></h2>
|
||||
<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>
|
||||
</dl>
|
||||
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
|
||||
|
@ -477,9 +477,8 @@
|
||||
|
||||
<ul>
|
||||
<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>
|
||||
</ul>
|
||||
|
||||
@ -578,9 +577,8 @@
|
||||
|
||||
<ul>
|
||||
<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>
|
||||
</ul>
|
||||
|
||||
|
@ -177,6 +177,10 @@
|
||||
</table>
|
||||
<h2><a href="#Fields">Fields</a></h2>
|
||||
<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>
|
||||
<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>
|
||||
@ -817,6 +821,26 @@
|
||||
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
||||
|
||||
<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>
|
||||
<a name = "available_pos"></a>
|
||||
<strong>available_pos</strong>
|
||||
@ -1027,9 +1051,8 @@
|
||||
|
||||
<ul>
|
||||
<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>
|
||||
</ul>
|
||||
|
||||
|
@ -544,7 +544,7 @@
|
||||
<a href="../modules/Text.html#">Text</a>
|
||||
</li>
|
||||
<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
|
||||
</li>
|
||||
<li><span class="parameter">minimal_scale</span>
|
||||
|
@ -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_touch_end druid.event Event on touch end 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 touch_start_pos vector3 Touch start position
|
||||
---@field x number Current touch x 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 = {}
|
||||
|
||||
--- The @{Drag} constructor
|
||||
|
Loading…
x
Reference in New Issue
Block a user