mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
Update docs
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
<h2>Contents</h2>
|
||||
<ul>
|
||||
<li><a href="#Functions">Functions</a></li>
|
||||
<li><a href="#Tables">Tables</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -118,7 +119,6 @@ self.rich_text:set_text("Hello, Druid Rich Text!")
|
||||
font: string,
|
||||
image: druid.rich_text.image,
|
||||
default_animation: string,
|
||||
anchor: number,
|
||||
br: boolean,
|
||||
nobr: boolean,
|
||||
}
|
||||
@@ -150,10 +150,14 @@ type druid.rich_text.metrics = {
|
||||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#clean">clean()</a></td>
|
||||
<td class="name" nowrap><a href="#clear">clear()</a></td>
|
||||
<td class="summary">Clear all created words.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_line_metric">get_line_metric()</a></td>
|
||||
<td class="summary">Get current line metrics</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#get_words">get_words()</a></td>
|
||||
<td class="summary">Get all current words.</td>
|
||||
</tr>
|
||||
@@ -167,7 +171,14 @@ type druid.rich_text.metrics = {
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap><a href="#tagged">tagged(tag)</a></td>
|
||||
<td class="summary">Get all words, which has a passed tag</td>
|
||||
<td class="summary">Get all words, which has a passed tag.</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>
|
||||
|
||||
@@ -179,8 +190,8 @@ type druid.rich_text.metrics = {
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "clean"></a>
|
||||
<strong>clean()</strong>
|
||||
<a name = "clear"></a>
|
||||
<strong>clear()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Clear all created words.
|
||||
@@ -191,6 +202,26 @@ type druid.rich_text.metrics = {
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_line_metric"></a>
|
||||
<strong>get_line_metric()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Get current line metrics
|
||||
|
||||
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><span class="type">druid.rich_text.lines_metrics</span></span>
|
||||
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "get_words"></a>
|
||||
@@ -205,7 +236,7 @@ type druid.rich_text.metrics = {
|
||||
<ol>
|
||||
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
Words
|
||||
druid.rich_text.word[]
|
||||
</ol>
|
||||
|
||||
|
||||
@@ -325,7 +356,7 @@ Words <nobr>inside tag</nobr> won't <span class="keyword">break</spa
|
||||
<strong>tagged(tag)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Get all words, which has a passed tag
|
||||
Get all words, which has a passed tag.
|
||||
|
||||
|
||||
<h3>Parameters:</h3>
|
||||
@@ -339,13 +370,51 @@ Words <nobr>inside tag</nobr> won't <span class="keyword">break</spa
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
Words
|
||||
<span class="types"><span class="type">druid.rich_text.word[]</span></span>
|
||||
words
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</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">COLORS</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
|
||||
Rich Text color aliases
|
||||
(<em>default</em> {})
|
||||
</li>
|
||||
<li><span class="parameter">ADJUST_STEPS</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Amount steps of attemps text adjust by height
|
||||
(<em>default</em> 20)
|
||||
</li>
|
||||
<li><span class="parameter">ADJUST_SCALE_DELTA</span>
|
||||
<span class="types"><span class="type">number</span></span>
|
||||
Scale step on each height adjust step
|
||||
(<em>default</em> 0.02)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
Reference in New Issue
Block a user