Druid-Extension/docs/modules/RichInput.html
2024-10-17 02:02:07 +03:00

595 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="#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><a href="../modules/Progress.html">Progress</a></li>
<li><a href="../modules/RadioGroup.html">RadioGroup</a></li>
<li><strong>RichInput</strong></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>RichInput</code></h1>
<p>Druid Rich Input custom component.</p>
<p>
It's wrapper on Input component with cursor and placeholder text</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#get_text">get_text(self)</a></td>
<td class="summary">Set input field text</td>
</tr>
<tr>
<td class="name" nowrap><a href="#init">init(self, template, nodes)</a></td>
<td class="summary">The <a href="../modules/RichInput.html#">RichInput</a> constructor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#select">select(self)</a></td>
<td class="summary">Select input field</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_allowed_characters">set_allowed_characters(self, characters)</a></td>
<td class="summary">Set allowed charaters for input field.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_font">set_font(self, font)</a></td>
<td class="summary">Set input field font</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_placeholder">set_placeholder(self, placeholder_text)</a></td>
<td class="summary">Set placeholder text</td>
</tr>
<tr>
<td class="name" nowrap><a href="#set_text">set_text(self, text)</a></td>
<td class="summary">Set input field text</td>
</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#cursor">cursor</a></td>
<td class="summary">On input field text change to empty string callback(self, input_text)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#cursor_position">cursor_position</a></td>
<td class="summary">On input field text change to empty string callback(self, input_text)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#cursor_text">cursor_text</a></td>
<td class="summary">On input field text change to empty string callback(self, input_text)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#drag">drag</a></td>
<td class="summary">On input field text change to empty string callback(self, input_text)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#druid">druid</a></td>
<td class="summary">The component druid instance</td>
</tr>
<tr>
<td class="name" nowrap><a href="#input">input</a></td>
<td class="summary">On input field text change callback(self, input_text)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#input_text">input_text</a></td>
<td class="summary">On input field text change to empty string callback(self, input_text)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#placeholder">placeholder</a></td>
<td class="summary">On input field text change to max length string callback(self, input_text)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#placeholder">placeholder</a></td>
<td class="summary">On input field text change to empty string callback(self, input_text)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#root">root</a></td>
<td class="summary">Root node</td>
</tr>
<tr>
<td class="name" nowrap><a href="#text_position">text_position</a></td>
<td class="summary">On input field text change to empty string callback(self, input_text)</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "get_text"></a>
<strong>get_text(self)</strong>
</dt>
<dd>
Set input field text
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">RichInput</span></span>
<a href="../modules/RichInput.html#">RichInput</a>
</li>
</ul>
</dd>
<dt>
<a name = "init"></a>
<strong>init(self, template, nodes)</strong>
</dt>
<dd>
The <a href="../modules/RichInput.html#">RichInput</a> constructor
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">RichInput</span></span>
<a href="../modules/RichInput.html#">RichInput</a>
</li>
<li><span class="parameter">template</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
The template string name
</li>
<li><span class="parameter">nodes</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
Nodes table from gui.clone_tree
</li>
</ul>
</dd>
<dt>
<a name = "select"></a>
<strong>select(self)</strong>
</dt>
<dd>
Select input field
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">RichInput</span></span>
<a href="../modules/RichInput.html#">RichInput</a>
</li>
</ul>
</dd>
<dt>
<a name = "set_allowed_characters"></a>
<strong>set_allowed_characters(self, characters)</strong>
</dt>
<dd>
Set allowed charaters for input field.
See: https://defold.com/ref/stable/string/
ex: [%a%d] for alpha and numeric
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">RichInput</span></span>
<a href="../modules/RichInput.html#">RichInput</a>
</li>
<li><span class="parameter">characters</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
Regulax exp. for validate user input
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">RichInput</span></span>
Current instance
</ol>
</dd>
<dt>
<a name = "set_font"></a>
<strong>set_font(self, font)</strong>
</dt>
<dd>
Set input field font
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">RichInput</span></span>
<a href="../modules/RichInput.html#">RichInput</a>
</li>
<li><span class="parameter">font</span>
<span class="types"><span class="type">hash</span></span>
The font hash
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">druid.input</span></span>
Current input instance
</ol>
</dd>
<dt>
<a name = "set_placeholder"></a>
<strong>set_placeholder(self, placeholder_text)</strong>
</dt>
<dd>
Set placeholder text
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">RichInput</span></span>
<a href="../modules/RichInput.html#">RichInput</a>
</li>
<li><span class="parameter">placeholder_text</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
The placeholder text
</li>
</ul>
</dd>
<dt>
<a name = "set_text"></a>
<strong>set_text(self, text)</strong>
</dt>
<dd>
Set input field text
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">self</span>
<span class="types"><span class="type">RichInput</span></span>
<a href="../modules/RichInput.html#">RichInput</a>
</li>
<li><span class="parameter">text</span>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
The input text
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">druid.input</span></span>
Current input instance
</ol>
</dd>
</dl>
<h2 class="section-header "><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "cursor"></a>
<strong>cursor</strong>
</dt>
<dd>
On input field text change to empty string callback(self, input_text)
<ul>
<li><span class="parameter">cursor</span>
<span class="types"><span class="type">node</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "cursor_position"></a>
<strong>cursor_position</strong>
</dt>
<dd>
On input field text change to empty string callback(self, input_text)
<ul>
<li><span class="parameter">cursor_position</span>
<span class="types"><span class="type">vector3</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "cursor_text"></a>
<strong>cursor_text</strong>
</dt>
<dd>
On input field text change to empty string callback(self, input_text)
<ul>
<li><span class="parameter">cursor_text</span>
<span class="types"><span class="type">node</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "drag"></a>
<strong>drag</strong>
</dt>
<dd>
On input field text change to empty string callback(self, input_text)
<ul>
<li><span class="parameter">drag</span>
<span class="types"><span class="type">druid.drag</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "druid"></a>
<strong>druid</strong>
</dt>
<dd>
The component druid instance
<ul>
<li><span class="parameter">druid</span>
<span class="types"><span class="type">DruidInstance</span></span>
<a href="../modules/DruidInstance.html#">DruidInstance</a>
</li>
</ul>
</dd>
<dt>
<a name = "input"></a>
<strong>input</strong>
</dt>
<dd>
On input field text change callback(self, input_text)
<ul>
<li><span class="parameter">input</span>
<span class="types"><span class="type">Input</span></span>
<a href="../modules/Input.html#">Input</a>
</li>
</ul>
</dd>
<dt>
<a name = "input_text"></a>
<strong>input_text</strong>
</dt>
<dd>
On input field text change to empty string callback(self, input_text)
<ul>
<li><span class="parameter">input_text</span>
<span class="types"><span class="type">druid.text</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "placeholder"></a>
<strong>placeholder</strong>
</dt>
<dd>
On input field text change to max length string callback(self, input_text)
<ul>
<li><span class="parameter">placeholder</span>
<span class="types"><span class="type">druid.text</span></span>
<a href="../modules/Text.html#">Text</a>
</li>
</ul>
</dd>
<dt>
<a name = "placeholder"></a>
<strong>placeholder</strong>
</dt>
<dd>
On input field text change to empty string callback(self, input_text)
<ul>
<li><span class="parameter">placeholder</span>
<span class="types"><span class="type">druid.text</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "root"></a>
<strong>root</strong>
</dt>
<dd>
Root node
<ul>
<li><span class="parameter">root</span>
<span class="types"><span class="type">node</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "text_position"></a>
<strong>text_position</strong>
</dt>
<dd>
On input field text change to empty string callback(self, input_text)
<ul>
<li><span class="parameter">text_position</span>
<span class="types"><span class="type">vector3</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>