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