Update master documentation for changeset c34a2174fa
This commit is contained in:
parent
b3d695eddc
commit
24aea17963
463 changed files with 42787 additions and 2037 deletions
|
|
@ -1216,21 +1216,11 @@ function main() {
|
|||
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a class="reference reference-toplevel" href="#12" id="62">Procs</a>
|
||||
<ul class="simple simple-toc-section">
|
||||
<li><a class="reference" href="#refcountIncremented,NimGodotObject"
|
||||
title="refcountIncremented*(obj: NimGodotObject)"><wbr />refcount<wbr />Incremented<span class="attachedType" style="visibility:hidden"></span></a></li>
|
||||
<li><a class="reference" href="#refcountDecremented,NimGodotObject"
|
||||
title="refcountDecremented*(obj: NimGodotObject): bool"><wbr />refcount<wbr />Decremented<span class="attachedType" style="visibility:hidden"></span></a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a class="reference reference-toplevel" href="#16" id="66">Macros</a>
|
||||
<ul class="simple simple-toc-section">
|
||||
<li><a class="reference" href="#gdobj.m,untyped,untyped"
|
||||
title="gdobj*(definition: untyped; body: untyped): typed"><wbr />gdobj<span class="attachedType" style="visibility:hidden"></span></a></li>
|
||||
<li><a class="reference" href="#gdobj.m,untyped,typed"
|
||||
title="gdobj*(definition: untyped; body: typed): typed"><wbr />gdobj<span class="attachedType" style="visibility:hidden"></span></a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
|
@ -1245,40 +1235,46 @@ function main() {
|
|||
<h1><a class="toc-backref" href="#6">Imports</a></h1>
|
||||
<dl class="item">
|
||||
<a class="reference external" href="macros.html">macros</a>, <a class="reference external" href="tables.html">tables</a>, <a class="reference external" href="typetraits.html">typetraits</a>, <a class="reference external" href="godotinternal.html">godotinternal</a>, <a class="reference external" href="godotvariants.html">internal/godotvariants</a>, <a class="reference external" href="godotnim.html">godotnim</a>, <a class="reference external" href="variants.html">core/variants</a>
|
||||
</dl></div>
|
||||
<div class="section" id="12">
|
||||
<h1><a class="toc-backref" href="#12">Procs</a></h1>
|
||||
<dl class="item">
|
||||
<dt id="refcountIncremented"><a name="refcountIncremented,NimGodotObject"></a><pre><span class="Keyword">proc</span> <span class="Identifier">refcountIncremented</span><span class="Operator">*</span><span class="Other">(</span><span class="Identifier">obj</span><span class="Other">:</span> <span class="Identifier">NimGodotObject</span><span class="Other">)</span></pre></dt>
|
||||
<dd>
|
||||
|
||||
<a
|
||||
href="https://github.com/pragmagic/godot-nim/tree/61f87e757db64a92e9e0a0f182e9fd8bdd3a561b/godot/nim/godotmacros.nim#L277"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/pragmagic/godot-nim/edit/master/godot/nim/godotmacros.nim#L277" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
<dt id="refcountDecremented"><a name="refcountDecremented,NimGodotObject"></a><pre><span class="Keyword">proc</span> <span class="Identifier">refcountDecremented</span><span class="Operator">*</span><span class="Other">(</span><span class="Identifier">obj</span><span class="Other">:</span> <span class="Identifier">NimGodotObject</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span></pre></dt>
|
||||
<dd>
|
||||
|
||||
<a
|
||||
href="https://github.com/pragmagic/godot-nim/tree/61f87e757db64a92e9e0a0f182e9fd8bdd3a561b/godot/nim/godotmacros.nim#L280"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/pragmagic/godot-nim/edit/master/godot/nim/godotmacros.nim#L280" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
|
||||
</dl></div>
|
||||
<div class="section" id="16">
|
||||
<h1><a class="toc-backref" href="#16">Macros</a></h1>
|
||||
<dl class="item">
|
||||
<dt id="gdobj"><a name="gdobj.m,untyped,untyped"></a><pre><span class="Keyword">macro</span> <span class="Identifier">gdobj</span><span class="Operator">*</span><span class="Other">(</span><span class="Identifier">definition</span><span class="Other">:</span> <span class="Identifier">untyped</span><span class="Other">;</span> <span class="Identifier">body</span><span class="Other">:</span> <span class="Identifier">untyped</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">typed</span></pre></dt>
|
||||
<dt id="gdobj"><a name="gdobj.m,untyped,typed"></a><pre><span class="Keyword">macro</span> <span class="Identifier">gdobj</span><span class="Operator">*</span><span class="Other">(</span><span class="Identifier">definition</span><span class="Other">:</span> <span class="Identifier">untyped</span><span class="Other">;</span> <span class="Identifier">body</span><span class="Other">:</span> <span class="Identifier">typed</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">typed</span> <span class="Other pragmabegin">{.</span><div class="pragma"><span class="Identifier">immediate</span></div><span class="Other pragmaend">.}</span></pre></dt>
|
||||
<dd>
|
||||
Generates Godot type. Self-documenting example:<pre class="listing"><span class="Keyword">import</span> <span class="Identifier">godot</span><span class="Punctuation">,</span> <span class="Identifier">node</span>
|
||||
|
||||
<span class="Identifier">gdobj</span> <span class="Identifier">MyObj</span> <span class="Keyword">of</span> <span class="Identifier">Node</span><span class="Punctuation">:</span>
|
||||
<span class="Keyword">var</span> <span class="Identifier">myField</span><span class="Punctuation">:</span> <span class="Identifier">int</span>
|
||||
<span class="Comment">## Not exported to Godot (i.e. editor will not see this field).</span>
|
||||
|
||||
<span class="Keyword">var</span> <span class="Identifier">myString</span><span class="Operator">*</span> <span class="Punctuation">{</span><span class="Operator">.</span><span class="Identifier">gdExport</span><span class="Punctuation">,</span> <span class="Identifier">hint</span><span class="Punctuation">:</span> <span class="Identifier">Length</span><span class="Punctuation">,</span> <span class="Identifier">tip</span><span class="Punctuation">:</span> <span class="StringLit">"20"</span><span class="Operator">.</span><span class="Punctuation">}</span><span class="Punctuation">:</span> <span class="Identifier">string</span>
|
||||
<span class="Comment">## Exported to Godot as ``my_string``.</span>
|
||||
<span class="Comment">## Editor will limit this string to length 20.</span>
|
||||
<span class="Comment">## ``hint` is a value of ``GodotPropertyHint`` enum.</span>
|
||||
<span class="Comment">## ``tip`` depends on the value of ``hint``, its format is described</span>
|
||||
<span class="Comment">## in ``GodotPropertyHint`` documentation.</span>
|
||||
|
||||
<span class="Keyword">method</span> <span class="Identifier">ready</span><span class="Operator">*</span><span class="Punctuation">(</span><span class="Punctuation">)</span> <span class="Operator">=</span>
|
||||
<span class="Comment">## Exported methods are exported to Godot by default,</span>
|
||||
<span class="Comment">## and their Godot names are prefixed with ``_``</span>
|
||||
<span class="Comment">## (in this case ``_ready``)</span>
|
||||
<span class="Identifier">print</span><span class="Punctuation">(</span><span class="StringLit">"I am ready! myString is: "</span> <span class="Operator">&</span> <span class="Identifier">myString</span><span class="Punctuation">)</span>
|
||||
|
||||
<span class="Keyword">proc</span> <span class="Identifier">myProc</span><span class="Operator">*</span><span class="Punctuation">(</span><span class="Punctuation">)</span> <span class="Punctuation">{</span><span class="Operator">.</span><span class="Identifier">gdExport</span><span class="Operator">.</span><span class="Punctuation">}</span> <span class="Operator">=</span>
|
||||
<span class="Comment">## Exported to Godot as ``my_proc``</span>
|
||||
<span class="Identifier">print</span><span class="Punctuation">(</span><span class="StringLit">"myProc is called! Incrementing myField."</span><span class="Punctuation">)</span>
|
||||
<span class="Identifier">inc</span> <span class="Identifier">myField</span></pre><p>If parent type is omitted, the type is inherited from <tt class="docutils literal"><span class="pre">Object</span></tt>.</p>
|
||||
<p><tt class="docutils literal"><span class="pre">tool</span></tt> specifier can be added to mark the type as an <a class="reference external" href="https://godot.readthedocs.io/en/stable/development/plugins/making_plugins.html">editor plugin</a>:</p>
|
||||
<pre class="listing"><span class="Keyword">import</span> <span class="Identifier">godot</span><span class="Punctuation">,</span> <span class="Identifier">editor_plugin</span>
|
||||
|
||||
<span class="Identifier">gdobj</span><span class="Punctuation">(</span><span class="Identifier">MyTool</span> <span class="Keyword">of</span> <span class="Identifier">EditorPlugin</span><span class="Punctuation">,</span> <span class="Identifier">tool</span><span class="Punctuation">)</span><span class="Punctuation">:</span>
|
||||
<span class="Keyword">method</span> <span class="Identifier">enterTree</span><span class="Operator">*</span><span class="Punctuation">(</span><span class="Punctuation">)</span> <span class="Operator">=</span>
|
||||
<span class="Identifier">print</span><span class="Punctuation">(</span><span class="StringLit">"MyTool initialized!"</span><span class="Punctuation">)</span></pre><p>Objects can be instantiated by invoking <a class="reference external" href="godotnim.html#gdnew">gdnew</a> or by using <a class="reference external" href="godotapi/resource_loader.html#load,string,string,bool">load</a> or any other way that you can find in <a class="reference external" href="index.html#modules-godot-api">Godot API</a>.</p>
|
||||
|
||||
<a
|
||||
href="https://github.com/pragmagic/godot-nim/tree/61f87e757db64a92e9e0a0f182e9fd8bdd3a561b/godot/nim/godotmacros.nim#L505"
|
||||
href="https://github.com/pragmagic/godot-nim/tree/c34a2174fa623bf2ddfa4f03e9a6104211066d97/godot/nim/godotmacros.nim#L567"
|
||||
class="link-seesrc" target="_blank">Source</a>
|
||||
<a href="https://github.com/pragmagic/godot-nim/edit/master/godot/nim/godotmacros.nim#L505" class="link-seesrc" target="_blank" >Edit</a>
|
||||
<a href="https://github.com/pragmagic/godot-nim/edit/master/godot/nim/godotmacros.nim#L567" class="link-seesrc" target="_blank" >Edit</a>
|
||||
|
||||
</dd>
|
||||
|
||||
|
|
@ -1291,7 +1287,7 @@ class="link-seesrc" target="_blank">Source</a>
|
|||
<div class="twelve-columns footer">
|
||||
<span class="nim-sprite"></span>
|
||||
<br/>
|
||||
<small>Made with Nim. Generated: 2017-08-01 12:15:52 UTC</small>
|
||||
<small>Made with Nim. Generated: 2017-08-03 04:45:34 UTC</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue