Update master documentation for changeset d11856377e
This commit is contained in:
parent
ac56035be7
commit
7cb156b910
31 changed files with 1966 additions and 1789 deletions
|
|
@ -1222,7 +1222,7 @@ function main() {
|
|||
</div>
|
||||
<ul class="simple simple-toc" id="toc-list">
|
||||
<li><a class="reference" id="getting-started_toc" href="#getting-started">Getting Started</a></li>
|
||||
<ul class="simple"><li><a class="reference" id="getting-started-building-godot_toc" href="#getting-started-building-godot">Building Godot</a></li>
|
||||
<ul class="simple"><li><a class="reference" id="getting-started-getting-godot_toc" href="#getting-started-getting-godot">Getting Godot</a></li>
|
||||
<li><a class="reference" id="getting-started-installing-nim_toc" href="#getting-started-installing-nim">Installing Nim</a></li>
|
||||
<li><a class="reference" id="getting-started-creating-project_toc" href="#getting-started-creating-project">Creating Project</a></li>
|
||||
<li><a class="reference" id="getting-started-adding-nim-to-existing-project_toc" href="#getting-started-adding-nim-to-existing-project">Adding Nim to Existing Project</a></li>
|
||||
|
|
@ -1238,28 +1238,26 @@ function main() {
|
|||
<div class="nine columns" id="content">
|
||||
<div id="tocRoot"></div>
|
||||
<p class="module-desc"><table class="docinfo" frame="void" rules="none"><col class="docinfo-name" /><col class="docinfo-content" /><tbody valign="top"><tr><th class="docinfo-name">Author:</th><td> Ruslan Mustakov</td></tr>
|
||||
<tr><th class="docinfo-name">Version:</th><td> 0.7.4</td></tr>
|
||||
<tr><th class="docinfo-name">Version:</th><td> 0.7.6</td></tr>
|
||||
<tr><th class="docinfo-name">GitHub:</th><td> <a class="reference external" href="https://github.com/pragmagic/godot-nim">https://github.com/pragmagic/godot-nim</a></td></tr>
|
||||
<tr><th class="docinfo-name">License:</th><td> MIT</td></tr>
|
||||
</tbody></table><p><tt class="docutils literal"><span class="pre">godot-nim</span></tt> library allows to create games on <a class="reference external" href="https://godotengine.org/">Godot Engine</a> with <a class="reference external" href="https://nim-lang.org/">Nim programming language</a>. Nim is a statically typed language with an elegant Python-like syntax that compiles to native code. It is garbage-collected, but its GC supports real-time mode which this library makes use of. It means the GC will never run during game frames and will use fixed amount of frame idle time to collect garbage. This leads to no stalls and close to zero compromise on performance comparing to native languages with manual memory management.</p>
|
||||
<p>If you are not familiar with Nim yet, it is recommended to go through the <a class="reference external" href="https://nim-lang.org/docs/tut1.html">official tutorial</a>.</p>
|
||||
<p><a class="reference external" href="https://code.visualstudio.com/">VSCode</a> is the recommended editor for working with Nim code. It is cross-platform and has the excellent <a class="reference external" href="https://marketplace.visualstudio.com/items?itemName=kosz78.nim">nim plugin</a> that supports most of the features you would expect from an IDE. It also has <a class="reference external" href="https://marketplace.visualstudio.com/items?itemName=geequlim.godot-tools">godot-tools plugin</a> which adds features for editing GDScript and Godot resource files.</p>
|
||||
|
||||
<h1><a class="toc-backref" id="getting-started" href="#getting-started">Getting Started</a></h1>
|
||||
<h2><a class="toc-backref" id="getting-started-building-godot" href="#getting-started-building-godot">Building Godot</a></h2><p>The library requires a not yet released Godot version 3.0, which you can build yourself by running the commands below (requires <a class="reference external" href="https://git-scm.com/downloads">Git</a>, <a class="reference external" href="https://www.python.org/downloads/">Python 2.7</a>, <a class="reference external" href="http://www.scons.org/">SCons</a>):</p>
|
||||
<pre class="listing">git clone https://github.com/godotengine/godot.git
|
||||
cd godot
|
||||
scons platform=<your_platform></pre><p>where <tt class="docutils literal"><span class="pre"><your_platform></span></tt> can be <tt class="docutils literal"><span class="pre">windows</span></tt>, <tt class="docutils literal"><span class="pre">osx</span></tt>, <tt class="docutils literal"><span class="pre">x11</span></tt>. After build is finished, Godot binaries will be under the <tt class="docutils literal"><span class="pre">bin</span></tt> folder. More details about compiling Godot can be found in <a class="reference external" href="https://godot.readthedocs.io/en/stable/development/compiling/index.html">Godot documentation</a>.</p>
|
||||
<h2><a class="toc-backref" id="getting-started-getting-godot" href="#getting-started-getting-godot">Getting Godot</a></h2><p>The library requires Godot version 3.0, which you can get here: <a class="reference external" href="https://godotengine.org/download">https://godotengine.org/download</a></p>
|
||||
|
||||
<h2><a class="toc-backref" id="getting-started-installing-nim" href="#getting-started-installing-nim">Installing Nim</a></h2><p>The library requires Nim version 0.18.0 or newer, which you can get here: <a class="reference external" href="https://nim-lang.org/install.html">https://nim-lang.org/install.html</a></p>
|
||||
<p>Make sure you also have <tt class="docutils literal"><span class="pre">nimble</span></tt> (Nim's package manager) installed.</p>
|
||||
|
||||
<h2><a class="toc-backref" id="getting-started-creating-project" href="#getting-started-creating-project">Creating Project</a></h2><p>The fastest way to set up a Godot-Nim project is to use an existing stub:</p>
|
||||
<h2><a class="toc-backref" id="getting-started-creating-project" href="#getting-started-creating-project">Creating Project</a></h2><p>The fastest way to set up a Godot-Nim project is to use the existing stub:</p>
|
||||
<pre class="listing">git clone --depth=1 https://github.com/pragmagic/godot-nim-stub.git myproject</pre><p>(you can then delete the .git directory within to untie the project from the stub repository)</p>
|
||||
<p>The stub contains the necessary build configuration to compile your code for desktop and mobile platforms, as well as a couple of very simple scenes to help you get started. Consult the stub's <a class="reference external" href="https://github.com/pragmagic/godot-nim-stub">README</a> for information about compiling the project.</p>
|
||||
|
||||
<h2><a class="toc-backref" id="getting-started-adding-nim-to-existing-project" href="#getting-started-adding-nim-to-existing-project">Adding Nim to Existing Project</a></h2><p>If you would like to use Nim in an existing project:</p>
|
||||
<ol class="simple"><li>Copy <tt class="docutils literal"><span class="pre">nakefile.nim</span></tt> file and <tt class="docutils literal"><span class="pre">src</span></tt> directory from the stub described in the previous section above your Godot project folder. Adjust paths in build scripts (<tt class="docutils literal"><span class="pre">nakefile.nim</span></tt>, <tt class="docutils literal"><span class="pre">src/stub.nimble</span></tt>) according to your own project structure.</li>
|
||||
<li>Copy <tt class="docutils literal"><span class="pre">project/nimlib.tres</span></tt> to your Godot project folder. It is a GDNative library resource that contains paths to dynamic libraries compiled by Nim.</li>
|
||||
<li>Copy <tt class="docutils literal"><span class="pre">nimlib.gdnlib</span></tt> to your Godot project folder. It is a GDNative library resource that contains paths to dynamic libraries compiled by Nim.</li>
|
||||
</ol>
|
||||
|
||||
<h2><a class="toc-backref" id="getting-started-next-steps" href="#getting-started-next-steps">Next Steps</a></h2><p>Once you are familiarized with the build process (it's as simple as running <tt class="docutils literal"><span class="pre">nake build</span></tt> after you are set up), it is recommended to go through <a class="reference external" href="godotmacros.html">godotmacros</a> and <a class="reference external" href="godotnim.html">godotnim</a> module documentations. They describe special macros and procedures needed to define or instantiate Godot objects. After you learned that, the rest is similar to using any Nim library. These bindings do not limit any of Nim's capabilities, and you can use any Nim types as fields or parameters of Godot objects and their procedures (but, obviously, you may not be able to export some of them to Godot editor or GDScript, unless you define your own converters).</p>
|
||||
|
|
@ -1292,7 +1290,7 @@ scons platform=<your_platform></pre><p>where <tt class="docutils literal">
|
|||
<li><a class="reference external" href="godotbase.html">godotbase</a> Defines <tt class="docutils literal"><span class="pre">Error</span></tt> type and few common math procedures missing in Nim's standard library.</li>
|
||||
</ul>
|
||||
|
||||
<h2><a class="toc-backref" id="modules-godot-api" href="#modules-godot-api">Godot API</a></h2><p>This is an auto-generated list of Godot API modules. It's built from Godot changeset <a class="reference external" href="https://github.com/godotengine/godot/commit/8afe5b4d9fa50d807f79006ab457c41e4de83247">8afe5b4d9fa50d807f79006ab457c41e4de83247</a>.</p>
|
||||
<h2><a class="toc-backref" id="modules-godot-api" href="#modules-godot-api">Godot API</a></h2><p>This is an auto-generated list of Godot API modules. It's built from Godot changeset <a class="reference external" href="https://github.com/godotengine/godot/commit/d05d4c2bddff05967c8d59137e5c13b576f7cb51">d05d4c2bddff05967c8d59137e5c13b576f7cb51</a>.</p>
|
||||
|
||||
<h2><a class="toc-backref" id="modules-godotinternal-module" href="#modules-godotinternal-module">godotinternal Module</a></h2><p>Contains low-level wrappers over Godot types that require manual memory management. This module is used within <tt class="docutils literal"><span class="pre">godot-nim</span></tt> implementation and you don't need to import it unless you know what you are doing.</p>
|
||||
<ul class="simple"><li><a class="reference external" href="godotdictionaries.html">godotdictionaries</a></li>
|
||||
|
|
@ -1310,7 +1308,7 @@ scons platform=<your_platform></pre><p>where <tt class="docutils literal">
|
|||
<div class="twelve-columns footer">
|
||||
<span class="nim-sprite"></span>
|
||||
<br/>
|
||||
<small>Made with Nim. Generated: 2018-01-25 12:11:32 UTC</small>
|
||||
<small>Made with Nim. Generated: 2018-02-17 17:21:30 UTC</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue