mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 18:37:44 +02:00
573 lines
14 KiB
HTML
573 lines
14 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 Framework</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>
|
|
<li><a href="#Fields">Fields</a></li>
|
|
</ul>
|
|
|
|
|
|
<h2>Modules</h2>
|
|
<ul class="nowrap">
|
|
<li><a href="../modules/BackHandler.html">BackHandler</a></li>
|
|
<li><a href="../modules/BaseComponent.html">BaseComponent</a></li>
|
|
<li><a href="../modules/Blocker.html">Blocker</a></li>
|
|
<li><a href="../modules/Button.html">Button</a></li>
|
|
<li><a href="../modules/Checkbox.html">Checkbox</a></li>
|
|
<li><a href="../modules/CheckboxGroup.html">CheckboxGroup</a></li>
|
|
<li><a href="../modules/DataList.html">DataList</a></li>
|
|
<li><a href="../modules/Drag.html">Drag</a></li>
|
|
<li><a href="../modules/Druid.html">Druid</a></li>
|
|
<li><a href="../modules/DruidEvent.html">DruidEvent</a></li>
|
|
<li><a href="../modules/DruidInstance.html">DruidInstance</a></li>
|
|
<li><a href="../modules/DynamicGrid.html">DynamicGrid</a></li>
|
|
<li><a href="../modules/Helper.html">Helper</a></li>
|
|
<li><a href="../modules/Hotkey.html">Hotkey</a></li>
|
|
<li><a href="../modules/Hover.html">Hover</a></li>
|
|
<li><a href="../modules/Input.html">Input</a></li>
|
|
<li><a href="../modules/LangText.html">LangText</a></li>
|
|
<li><a href="../modules/Layout.html">Layout</a></li>
|
|
<li><strong>Progress</strong></li>
|
|
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
|
|
<li><a href="../modules/RichInput.html">RichInput</a></li>
|
|
<li><a href="../modules/RichText.html">RichText</a></li>
|
|
<li><a href="../modules/Scroll.html">Scroll</a></li>
|
|
<li><a href="../modules/Slider.html">Slider</a></li>
|
|
<li><a href="../modules/StaticGrid.html">StaticGrid</a></li>
|
|
<li><a href="../modules/Swipe.html">Swipe</a></li>
|
|
<li><a href="../modules/Text.html">Text</a></li>
|
|
<li><a href="../modules/Timer.html">Timer</a></li>
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div id="content">
|
|
|
|
<h1>Module <code>Progress</code></h1>
|
|
<p>Druid component to handle the progress bars.</p>
|
|
<p>
|
|
<b># Overview #</b>
|
|
<p> <b># Notes #</b>
|
|
<p> • Progress Node should be fully filled in your GUI scene node. It will be the progress maximum size
|
|
<p> • Progress correct working with Slice9 nodes, it trying to set size by _set_size_ first, if it is not possible, it set up sizing via _set_scale_
|
|
<p> • Progress bar can fill only by vertical or horizontal size. If you want make diagonal progress bar, just rotate node in GUI scene
|
|
<p> • If you have glitchy or dark texture bug with progress bar, try to disable mipmaps in your texture profiles
|
|
<p>
|
|
<a href="https://insality.github.io/druid/druid/index.html?example=general_progress_bar" target="_blank"><b>Example Link</b></a></p>
|
|
|
|
|
|
<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>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#fill">fill(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">The <a href="../modules/Progress.html#">Progress</a> constructor</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#set_max_size">set_max_size(self, max_size)</a></td>
|
|
<td class="summary">Set progress bar max node size</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="#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="#to">to(self, to, callback)</a></td>
|
|
<td class="summary">Start animation of a progress bar</td>
|
|
</tr>
|
|
</table>
|
|
<h2><a href="#Tables">Tables</a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap><a href="#style">style</a></td>
|
|
<td class="summary">Component style params.</td>
|
|
</tr>
|
|
</table>
|
|
<h2><a href="#Fields">Fields</a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap><a href="#key">key</a></td>
|
|
<td class="summary">The progress bar direction.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#max_size">max_size</a></td>
|
|
<td class="summary">Maximum size of progress bar</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#node">node</a></td>
|
|
<td class="summary">Progress bar fill node</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#on_change">on_change</a></td>
|
|
<td class="summary">On progress bar change callback(self, new_value)</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#scale">scale</a></td>
|
|
<td class="summary">Current progress bar scale</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#size">size</a></td>
|
|
<td class="summary">Current progress bar size</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#slice">slice</a></td>
|
|
<td class="summary">Progress bar slice9 settings</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br/>
|
|
<br/>
|
|
|
|
|
|
<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"><span class="type">Progress</span></span>
|
|
<a href="../modules/Progress.html#">Progress</a>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "fill"></a>
|
|
<strong>fill(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"><span class="type">Progress</span></span>
|
|
<a href="../modules/Progress.html#">Progress</a>
|
|
</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"><span class="type">Progress</span></span>
|
|
<a href="../modules/Progress.html#">Progress</a>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "init"></a>
|
|
<strong>init(self, node, key, init_value)</strong>
|
|
</dt>
|
|
<dd>
|
|
The <a href="../modules/Progress.html#">Progress</a> constructor
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">self</span>
|
|
<span class="types"><span class="type">Progress</span></span>
|
|
<a href="../modules/Progress.html#">Progress</a>
|
|
</li>
|
|
<li><span class="parameter">node</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a> or <a class="type" href="../modules/Progress.html#node">node</a></span>
|
|
Node name or GUI Node itself.
|
|
</li>
|
|
<li><span class="parameter">key</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
|
Progress bar direction: const.SIDE.X or const.SIDE.Y
|
|
</li>
|
|
<li><span class="parameter">init_value</span>
|
|
<span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
|
|
Initial value of progress bar. Default: 1
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "set_max_size"></a>
|
|
<strong>set_max_size(self, max_size)</strong>
|
|
</dt>
|
|
<dd>
|
|
Set progress bar max node size
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">self</span>
|
|
<span class="types"><span class="type">Progress</span></span>
|
|
<a href="../modules/Progress.html#">Progress</a>
|
|
</li>
|
|
<li><span class="parameter">max_size</span>
|
|
<span class="types"><span class="type">vector3</span></span>
|
|
The new node maximum (full) size
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><span class="type">Progress</span></span>
|
|
<a href="../modules/Progress.html#">Progress</a>
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</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"><span class="type">Progress</span></span>
|
|
<a href="../modules/Progress.html#">Progress</a>
|
|
</li>
|
|
<li><span class="parameter">steps</span>
|
|
<span class="types"><span class="type">number[]</span></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>
|
|
|
|
|
|
|
|
|
|
<h3>Usage:</h3>
|
|
<ul>
|
|
<pre class="example">progress:set_steps({<span class="number">0</span>, <span class="number">0.3</span>, <span class="number">0.6</span>, <span class="number">1</span>}, <span class="keyword">function</span>(self, step) <span class="keyword">end</span>)</pre>
|
|
</ul>
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "set_to"></a>
|
|
<strong>set_to(self, to)</strong>
|
|
</dt>
|
|
<dd>
|
|
Instant fill progress bar to value
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">self</span>
|
|
<span class="types"><span class="type">Progress</span></span>
|
|
<a href="../modules/Progress.html#">Progress</a>
|
|
</li>
|
|
<li><span class="parameter">to</span>
|
|
<span class="types"><span class="type">number</span></span>
|
|
Progress bar value, from 0 to 1
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "to"></a>
|
|
<strong>to(self, to, callback)</strong>
|
|
</dt>
|
|
<dd>
|
|
Start animation of a progress bar
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">self</span>
|
|
<span class="types"><span class="type">Progress</span></span>
|
|
<a href="../modules/Progress.html#">Progress</a>
|
|
</li>
|
|
<li><span class="parameter">to</span>
|
|
<span class="types"><span class="type">number</span></span>
|
|
value between 0..1
|
|
</li>
|
|
<li><span class="parameter">callback</span>
|
|
<span class="types"><span class="type">function</span> or <span class="type">nil</span></span>
|
|
Callback on animation ends
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
|
|
|
|
<dl class="function">
|
|
<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">SPEED</span>
|
|
<span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
|
|
Progress bas fill rate. More -> faster. Default: 5
|
|
</li>
|
|
<li><span class="parameter">MIN_DELTA</span>
|
|
<span class="types"><span class="type">number</span> or <span class="type">nil</span></span>
|
|
Minimum step to fill progress bar. Default: 0.005
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
|
|
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "key"></a>
|
|
<strong>key</strong>
|
|
</dt>
|
|
<dd>
|
|
The progress bar direction.
|
|
<p> The values are: "x" or "y". (const.SIDE.X or const.SIDE.Y)
|
|
|
|
|
|
<ul>
|
|
<li><span class="parameter">key</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "max_size"></a>
|
|
<strong>max_size</strong>
|
|
</dt>
|
|
<dd>
|
|
Maximum size of progress bar
|
|
|
|
|
|
<ul>
|
|
<li><span class="parameter">max_size</span>
|
|
<span class="types"><span class="type">number</span></span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "node"></a>
|
|
<strong>node</strong>
|
|
</dt>
|
|
<dd>
|
|
Progress bar fill node
|
|
|
|
|
|
<ul>
|
|
<li><span class="parameter">node</span>
|
|
<span class="types"><a class="type" href="../modules/Progress.html#node">node</a></span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "on_change"></a>
|
|
<strong>on_change</strong>
|
|
</dt>
|
|
<dd>
|
|
On progress bar change callback(self, new_value)
|
|
|
|
|
|
<ul>
|
|
<li><span class="parameter">on_change</span>
|
|
<span class="types"><span class="type">DruidEvent</span></span>
|
|
<a href="../modules/DruidEvent.html#">DruidEvent</a>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "scale"></a>
|
|
<strong>scale</strong>
|
|
</dt>
|
|
<dd>
|
|
Current progress bar scale
|
|
|
|
|
|
<ul>
|
|
<li><span class="parameter">scale</span>
|
|
<span class="types"><span class="type">vector3</span></span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "size"></a>
|
|
<strong>size</strong>
|
|
</dt>
|
|
<dd>
|
|
Current progress bar size
|
|
|
|
|
|
<ul>
|
|
<li><span class="parameter">size</span>
|
|
<span class="types"><span class="type">vector3</span></span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "slice"></a>
|
|
<strong>slice</strong>
|
|
</dt>
|
|
<dd>
|
|
Progress bar slice9 settings
|
|
|
|
|
|
<ul>
|
|
<li><span class="parameter">slice</span>
|
|
<span class="types"><span class="type">vector4</span></span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
</div> <!-- id="content" -->
|
|
</div> <!-- id="main" -->
|
|
<div id="about">
|
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc TESTING</a></i>
|
|
<i style="float:right;">Last updated 2015-01-01 12:00:00 </i>
|
|
</div> <!-- id="about" -->
|
|
</div> <!-- id="container" -->
|
|
</body>
|
|
</html>
|