mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 18:37:44 +02:00
448 lines
11 KiB
HTML
448 lines
11 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>
|
|
</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><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.grid.html">druid.grid</a></li>
|
|
<li><a href="../modules/druid.hover.html">druid.hover</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.scroll.html">druid.scroll</a></li>
|
|
<li><a href="../modules/druid.slider.html">druid.slider</a></li>
|
|
<li><a href="../modules/druid.text.html">druid.text</a></li>
|
|
<li><a href="../modules/druid.timer.html">druid.timer</a></li>
|
|
<li><strong>component</strong></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.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/README.md.html">README</a></li>
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div id="content">
|
|
|
|
<h1>Module <code>component</code></h1>
|
|
<p>Basic class for all Druid components.</p>
|
|
<p> To create you component, use <a href="../modules/component.html#Component.create">component.create</a></p>
|
|
|
|
|
|
<h2><a href="#Functions">Functions</a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap><a href="#get_style">get_style()</a></td>
|
|
<td class="summary">Get current component style table</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#set_style">set_style(style)</a></td>
|
|
<td class="summary">Set current component style table</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#get_template">get_template()</a></td>
|
|
<td class="summary">Get current component template name</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#set_template">set_template(template)</a></td>
|
|
<td class="summary">Set current component template name</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#get_nodes">get_nodes()</a></td>
|
|
<td class="summary">Get current component nodes</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#set_nodes">set_nodes(nodes)</a></td>
|
|
<td class="summary">Set current component nodes</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#get_context">get_context()</a></td>
|
|
<td class="summary">Get current component context</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#set_context">set_context(context)</a></td>
|
|
<td class="summary">Set current component context</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#get_interests">get_interests()</a></td>
|
|
<td class="summary">Get current component interests</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#get_node">get_node(node_or_name)</a></td>
|
|
<td class="summary">Get node for component by name.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#get_druid">get_druid()</a></td>
|
|
<td class="summary">Return druid with context of calling component.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#setup_component">setup_component(table, table)</a></td>
|
|
<td class="summary">Setup component context and his style table</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#Component.create">Component.create(name, interest)</a></td>
|
|
<td class="summary">Create new component.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br/>
|
|
<br/>
|
|
|
|
|
|
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
|
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "get_style"></a>
|
|
<strong>get_style()</strong>
|
|
</dt>
|
|
<dd>
|
|
Get current component style table
|
|
|
|
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
|
Component style table
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "set_style"></a>
|
|
<strong>set_style(style)</strong>
|
|
</dt>
|
|
<dd>
|
|
Set current component style table
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">style</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
|
Druid style module
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "get_template"></a>
|
|
<strong>get_template()</strong>
|
|
</dt>
|
|
<dd>
|
|
Get current component template name
|
|
|
|
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
|
|
Component template name
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "set_template"></a>
|
|
<strong>set_template(template)</strong>
|
|
</dt>
|
|
<dd>
|
|
Set current component template name
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">template</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
|
|
Component template name
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "get_nodes"></a>
|
|
<strong>get_nodes()</strong>
|
|
</dt>
|
|
<dd>
|
|
Get current component nodes
|
|
|
|
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
|
Component nodes table
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "set_nodes"></a>
|
|
<strong>set_nodes(nodes)</strong>
|
|
</dt>
|
|
<dd>
|
|
Set current component nodes
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">nodes</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
|
Component nodes table
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "get_context"></a>
|
|
<strong>get_context()</strong>
|
|
</dt>
|
|
<dd>
|
|
Get current component context
|
|
|
|
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
|
Component context
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "set_context"></a>
|
|
<strong>set_context(context)</strong>
|
|
</dt>
|
|
<dd>
|
|
Set current component context
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">context</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
|
Druid context. Usually it is self of script
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "get_interests"></a>
|
|
<strong>get_interests()</strong>
|
|
</dt>
|
|
<dd>
|
|
Get current component interests
|
|
|
|
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
|
List of component interests
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "get_node"></a>
|
|
<strong>get_node(node_or_name)</strong>
|
|
</dt>
|
|
<dd>
|
|
Get node for component by name.
|
|
If component has nodes, node<em>or</em>name should be string
|
|
It auto pick node by template name or from nodes by clone<em>tree
|
|
if they was setup via component:set</em>nodes, component:set_template
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">node_or_name</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a> or <span class="type">node</span></span>
|
|
Node name or node itself
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><span class="type">node</span></span>
|
|
Gui node
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "get_druid"></a>
|
|
<strong>get_druid()</strong>
|
|
</dt>
|
|
<dd>
|
|
Return druid with context of calling component.
|
|
Use it to create component inside of other components.
|
|
|
|
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><span class="type">Druid</span></span>
|
|
Druid instance with component context
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "setup_component"></a>
|
|
<strong>setup_component(table, table)</strong>
|
|
</dt>
|
|
<dd>
|
|
Setup component context and his style table
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">table</span>
|
|
<span class="types"><span class="type">style</span></span>
|
|
Druid style module
|
|
</li>
|
|
<li><span class="parameter">table</span>
|
|
<span class="types"><span class="type">style</span></span>
|
|
Druid style module
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><span class="type">Component</span></span>
|
|
Component itself
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "Component.create"></a>
|
|
<strong>Component.create(name, interest)</strong>
|
|
</dt>
|
|
<dd>
|
|
Create new component. It will inheritance from basic
|
|
druid component.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">name</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.4">string</a></span>
|
|
Component name
|
|
</li>
|
|
<li><span class="parameter">interest</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.3/manual.html#6.6">table</a></span>
|
|
List of component's interest
|
|
</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-04-13 19:36:00 </i>
|
|
</div> <!-- id="about" -->
|
|
</div> <!-- id="container" -->
|
|
</body>
|
|
</html>
|