1
0
Fork 0
mirror of https://github.com/Reuh/ubiquitousse.git synced 2025-10-27 17:19:31 +00:00

Update and rebuild docs

This commit is contained in:
Étienne Fildadut 2022-09-16 20:07:53 +09:00
parent 21679dde5c
commit 7ad5c2d641
19 changed files with 3026 additions and 949 deletions

View file

@ -50,6 +50,7 @@
<li><a href="../modules/ubiquitousse.html">ubiquitousse</a></li>
<li><a href="../modules/asset.html">asset</a></li>
<li><a href="../modules/ecs.html">ecs</a></li>
<li><a href="../modules/input.html">input</a></li>
<li><strong>ldtk</strong></li>
<li><a href="../modules/scene.html">scene</a></li>
<li><a href="../modules/signal.html">signal</a></li>
@ -68,15 +69,22 @@
<h1>Module <code>ldtk</code></h1>
<p><a href="https://ldtk.io/">LDtk</a> level importer for Lua and drawing using LÖVE.</p>
<p> Support most LDtk features, and allow easy usage in LÖVE projects.</p>
<p> Support most LDtk features, and allow easy usage in LÖVE projects.
In particular, this mainly focus only on features and values that are useful for showing the final level &ndash; this does not try, for example, to expose
every internal identfiers or intermediates values that are only relevant for editing.</p>
<p> Currently up-to-date with LDtk 1.1.3.</p>
<p> Every unit is in pixel in the API unless written otherwise.
Colors are reprsented as a table <code>{r,g,b}</code> where <code>r</code>,<code>b</code>,<code>g</code> in [0-1].</p>
<p> This modules returns a single function, <a href="../modules/ldtk.html#LDtk">LDtk</a>(path).</p>
<p> No mandatory dependency.
Optionally requires LÖVE <code>love.graphics</code> (drawing Image, SpriteBatch, Quad) for drawing only.</p>
<p> This modules requires <a href="https://github.com/rxi/json.lua">json.lua</a>; a copy of it is included with ubiquitousse in the <code>lib</code> directory for simplicity.
This module will first try to load a global module named <code>json</code> &ndash; so if you use the same json module in your project ubiquitousse will reuse it.
If it doesn&rsquo;t find it, it will then try to load the copy included with ubiquitousse.</p>
<p> Optionally requires LÖVE <code>love.graphics</code> (drawing Image, SpriteBatch, Quad), for drawing only.</p>
<h3>Usage:</h3>
<ul>
<pre class="example">local ldtk = require(&quot;ubiquitousse.ldtk&quot;)
@ -116,24 +124,28 @@ end
<td class="summary"><a href="../modules/ldtk.html#Layer_objects">Layer</a> this entity belongs to.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Entity.iid">Entity.iid</a></td>
<td class="summary">Unique instance identifier for this entity.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Entity.identifier">Entity.identifier</a></td>
<td class="summary">The entity name.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Entity.x">Entity.x</a></td>
<td class="summary">X position of the entity relative to the layer.</td>
<td class="summary">X position of the entity relative to the layer, in pixels.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Entity.y">Entity.y</a></td>
<td class="summary">Y position of the entity relative to the layer.</td>
<td class="summary">Y position of the entity relative to the layer, in pixels.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Entity.width">Entity.width</a></td>
<td class="summary">The entity width.</td>
<td class="summary">The entity width, in pixels.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Entity.height">Entity.height</a></td>
<td class="summary">The entity height.</td>
<td class="summary">The entity height, in pixels.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Entity.sx">Entity.sx</a></td>
@ -145,11 +157,11 @@ end
</tr>
<tr>
<td class="name" nowrap><a href="#Entity.pivotX">Entity.pivotX</a></td>
<td class="summary">The entity pivot point x position relative to the entity.</td>
<td class="summary">The entity pivot point x position relative to the entity, in pixels..</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Entity.pivotY">Entity.pivotY</a></td>
<td class="summary">The entity pivot point x position relative to the entity.</td>
<td class="summary">The entity pivot point x position relative to the entity, in pixels..</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Entity.color">Entity.color</a></td>
@ -160,6 +172,10 @@ end
<td class="summary">Tile associated with the entity, if any.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Entity.tags">Entity.tags</a></td>
<td class="summary">Tags associated with the entity: can be used either as a list of tags or a map of activated tags tags[name] == true.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Entity.fields">Entity.fields</a></td>
<td class="summary">Map of <a href="../modules/ldtk.html#CustomFields_objects">CustomFields</a> of the entity.</td>
</tr>
@ -174,6 +190,10 @@ end
<td class="name" nowrap><a href="#Tileset.image">Tileset.image</a></td>
<td class="summary">The tileset LÖVE image object.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Tileset.tags">Tileset.tags</a></td>
<td class="summary">Tags associated with the tileset: can be used either as a list of tags or a map of activated tags tags[name] == true.</td>
</tr>
</table>
<h2><a href="#Layer_objects">Layer objects </a></h2>
<table class="function_list">
@ -186,6 +206,10 @@ end
<td class="summary"><a href="../modules/ldtk.html#Level_objects">Level</a> this layer belongs to.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Layer.iid">Layer.iid</a></td>
<td class="summary">Unique instance identifier for this layer.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Layer.identifier">Layer.identifier</a></td>
<td class="summary">The layer name.</td>
</tr>
@ -226,6 +250,18 @@ end
<td class="summary">Height of the layer, in grid units.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Layer.parallaxFactorX">Layer.parallaxFactorX</a></td>
<td class="summary">Parallax horizontal factor (from -1 to 1, defaults to 0) which affects the scrolling speed of this layer, creating a fake 3D (parallax) effect.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Layer.parallaxFactorY">Layer.parallaxFactorY</a></td>
<td class="summary">Parallax vertical factor (from -1 to 1, defaults to 0) which affects the scrolling speed of this layer, creating a fake 3D (parallax) effect.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Layer.parallaxScaling">Layer.parallaxScaling</a></td>
<td class="summary">If true, a layer with a parallax factor will also be scaled up/down accordingly.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Layer.entities">Layer.entities</a></td>
<td class="summary"><em>(Entities layer only)</em> List of <a href="../modules/ldtk.html#Entity_objects">Entity</a> in the layer.</td>
</tr>
@ -254,11 +290,11 @@ end
</tr>
<tr>
<td class="name" nowrap><a href="#Tile.x">Tile.x</a></td>
<td class="summary">X position of the tile relative to the layer.</td>
<td class="summary">X position of the tile relative to the layer, in pixels.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Tile.y">Tile.y</a></td>
<td class="summary">Y position of the tile relative to the layer.</td>
<td class="summary">Y position of the tile relative to the layer, in pixels.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Tile.flipX">Tile.flipX</a></td>
@ -289,11 +325,11 @@ end
</tr>
<tr>
<td class="name" nowrap><a href="#IntTile.x">IntTile.x</a></td>
<td class="summary">X position of the IntTile relative to the layer.</td>
<td class="summary">X position of the IntTile relative to the layer, in pixels.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#IntTile.y">IntTile.y</a></td>
<td class="summary">Y position of the IntTile relative to the layer.</td>
<td class="summary">Y position of the IntTile relative to the layer, in pixels.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#IntTile.identifier">IntTile.identifier</a></td>
@ -335,16 +371,24 @@ end
<td class="summary">Whether this level is currently loaded or not.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Level.iid">Level.iid</a></td>
<td class="summary">Unique instance identifier for this level.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Level.identifier">Level.identifier</a></td>
<td class="summary">The level name.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Level.depth">Level.depth</a></td>
<td class="summary">Depth of the level in the world, to properly stack overlapping levels when drawing.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Level.x">Level.x</a></td>
<td class="summary">The level x position.</td>
<td class="summary">The level x position in pixels.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Level.y">Level.y</a></td>
<td class="summary">The level y position.</td>
<td class="summary">The level y position in pixels.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Level.width">Level.width</a></td>
@ -451,6 +495,27 @@ end
</dd>
<dt>
<a name = "Entity.iid"></a>
<strong>Entity.iid</strong>
</dt>
<dd>
Unique instance identifier for this entity.
</ul>
<h3>Type:</h3>
<ul>
<code>string</code>
</ul>
</ul>
</ul>
</dd>
<dt>
<a name = "Entity.identifier"></a>
@ -478,7 +543,7 @@ end
<strong>Entity.x</strong>
</dt>
<dd>
X position of the entity relative to the layer.
X position of the entity relative to the layer, in pixels.
</ul>
<h3>Type:</h3>
@ -499,7 +564,7 @@ end
<strong>Entity.y</strong>
</dt>
<dd>
Y position of the entity relative to the layer.
Y position of the entity relative to the layer, in pixels.
</ul>
<h3>Type:</h3>
@ -520,7 +585,7 @@ end
<strong>Entity.width</strong>
</dt>
<dd>
The entity width.
The entity width, in pixels.
</ul>
<h3>Type:</h3>
@ -541,7 +606,7 @@ end
<strong>Entity.height</strong>
</dt>
<dd>
The entity height.
The entity height, in pixels.
</ul>
<h3>Type:</h3>
@ -604,7 +669,7 @@ end
<strong>Entity.pivotX</strong>
</dt>
<dd>
The entity pivot point x position relative to the entity.
The entity pivot point x position relative to the entity, in pixels..
</ul>
<h3>Type:</h3>
@ -625,7 +690,7 @@ end
<strong>Entity.pivotY</strong>
</dt>
<dd>
The entity pivot point x position relative to the entity.
The entity pivot point x position relative to the entity, in pixels..
</ul>
<h3>Type:</h3>
@ -683,6 +748,27 @@ end
</dd>
<dt>
<a name = "Entity.tags"></a>
<strong>Entity.tags</strong>
</dt>
<dd>
Tags associated with the entity: can be used either as a list of tags or a map of activated tags tags[name] == true.
</ul>
<h3>Type:</h3>
<ul>
<code>{"tag",["tag"]=true,...}</code>
</ul>
</ul>
</ul>
</dd>
<dt>
<a name = "Entity.fields"></a>
@ -755,6 +841,27 @@ end
</dd>
<dt>
<a name = "Tileset.tags"></a>
<strong>Tileset.tags</strong>
</dt>
<dd>
Tags associated with the tileset: can be used either as a list of tags or a map of activated tags tags[name] == true.
</ul>
<h3>Type:</h3>
<ul>
<code>{"tag",["tag"]=true,...}</code>
</ul>
</ul>
</ul>
</dd>
</dl>
<h2 class="section-header has-description"><a name="Layer_objects"></a>Layer objects </h2>
@ -822,6 +929,27 @@ end
</dd>
<dt>
<a name = "Layer.iid"></a>
<strong>Layer.iid</strong>
</dt>
<dd>
Unique instance identifier for this layer.
</ul>
<h3>Type:</h3>
<ul>
<code>string</code>
</ul>
</ul>
</ul>
</dd>
<dt>
<a name = "Layer.identifier"></a>
@ -1032,6 +1160,69 @@ end
</dd>
<dt>
<a name = "Layer.parallaxFactorX"></a>
<strong>Layer.parallaxFactorX</strong>
</dt>
<dd>
Parallax horizontal factor (from -1 to 1, defaults to 0) which affects the scrolling speed of this layer, creating a fake 3D (parallax) effect.
</ul>
<h3>Type:</h3>
<ul>
<code>number</code>
</ul>
</ul>
</ul>
</dd>
<dt>
<a name = "Layer.parallaxFactorY"></a>
<strong>Layer.parallaxFactorY</strong>
</dt>
<dd>
Parallax vertical factor (from -1 to 1, defaults to 0) which affects the scrolling speed of this layer, creating a fake 3D (parallax) effect.
</ul>
<h3>Type:</h3>
<ul>
<code>number</code>
</ul>
</ul>
</ul>
</dd>
<dt>
<a name = "Layer.parallaxScaling"></a>
<strong>Layer.parallaxScaling</strong>
</dt>
<dd>
If true, a layer with a parallax factor will also be scaled up/down accordingly.
</ul>
<h3>Type:</h3>
<ul>
<code>boolean</code>
</ul>
</ul>
</ul>
</dd>
<dt>
<a name = "Layer.entities"></a>
@ -1039,6 +1230,7 @@ end
</dt>
<dd>
<em>(Entities layer only)</em> List of <a href="../modules/ldtk.html#Entity_objects">Entity</a> in the layer.
Each entity in the list is also bound to its IID in this table, so if <code>ent = entities[1]</code>, you can also find it at <code>entities[ent.iid]</code>.
</ul>
<h3>Type:</h3>
@ -1182,7 +1374,7 @@ end
<strong>Tile.x</strong>
</dt>
<dd>
X position of the tile relative to the layer.
X position of the tile relative to the layer, in pixels.
</ul>
<h3>Type:</h3>
@ -1203,7 +1395,7 @@ end
<strong>Tile.y</strong>
</dt>
<dd>
Y position of the tile relative to the layer.
Y position of the tile relative to the layer, in pixels.
</ul>
<h3>Type:</h3>
@ -1362,7 +1554,7 @@ end
<strong>IntTile.x</strong>
</dt>
<dd>
X position of the IntTile relative to the layer.
X position of the IntTile relative to the layer, in pixels.
</ul>
<h3>Type:</h3>
@ -1383,7 +1575,7 @@ end
<strong>IntTile.y</strong>
</dt>
<dd>
Y position of the IntTile relative to the layer.
Y position of the IntTile relative to the layer, in pixels.
</ul>
<h3>Type:</h3>
@ -1673,6 +1865,27 @@ end
</dd>
<dt>
<a name = "Level.iid"></a>
<strong>Level.iid</strong>
</dt>
<dd>
Unique instance identifier for this level.
</ul>
<h3>Type:</h3>
<ul>
<code>string</code>
</ul>
</ul>
</ul>
</dd>
<dt>
<a name = "Level.identifier"></a>
@ -1694,13 +1907,35 @@ end
</dd>
<dt>
<a name = "Level.depth"></a>
<strong>Level.depth</strong>
</dt>
<dd>
Depth of the level in the world, to properly stack overlapping levels when drawing. Default is 0, greater means above, lower means below.
</ul>
<h3>Type:</h3>
<ul>
<code>number</code>
</ul>
</ul>
</ul>
</dd>
<dt>
<a name = "Level.x"></a>
<strong>Level.x</strong>
</dt>
<dd>
The level x position.
The level x position in pixels.
For Horizontal and Vertical layouts, is always -1.
</ul>
<h3>Type:</h3>
@ -1721,7 +1956,8 @@ end
<strong>Level.y</strong>
</dt>
<dd>
The level y position.
The level y position in pixels.
For Horizontal and Vertical layouts, is always -1.
</ul>
<h3>Type:</h3>
@ -1806,6 +2042,7 @@ end
</dt>
<dd>
List of <a href="../modules/ldtk.html#Layer_objects">Layer</a>s in the level (table).
Each layer in the list is also bound to its IID in this table, so if <code>lay = layers[1]</code>, you can also find it at <code>layers[lay.iid]</code>.
</ul>
<h3>Type:</h3>
@ -1829,7 +2066,7 @@ end
Level background. </p>
<p> If there is a background image, <code>background.image</code> contains a table <code>{image=image, x=number, y=number, sx=number, sy=number}</code>
where <a href="../modules/ldtk.html#Tileset.image">image</a> is the LÖVE image (or image filepath if LÖVE not available) <a href="../modules/ldtk.html#Level.x">x</a> and <a href="../modules/ldtk.html#Level.y">y</a> are the top-left position,
where <a href="../modules/ldtk.html#Tileset.image">image</a> is the LÖVE image (or image filepath if LÖVE not available) <a href="../modules/ldtk.html#Entity.x">x</a> and <a href="../modules/ldtk.html#Tile.y">y</a> are the top-left position,
and <a href="../modules/ldtk.html#Entity.sx">sx</a> and <a href="../modules/ldtk.html#Entity.sy">sy</a> the horizontal and vertical scale factors.
</ul>
@ -1867,6 +2104,7 @@ end
</dt>
<dd>
List of <a href="../modules/ldtk.html#Level_objects">Level</a>s in this project.
Each level in the list is also bound to its IID in this table, so if <code>lvl = levels[1]</code>, you can also find it at <code>levels[lvl.iid]</code>.
</ul>
<h3>Type:</h3>
@ -1904,8 +2142,10 @@ end
<li>Enum are converted into a Lua string giving the currently selected enum value.</li>
<li>Filepath are converted into a Lua string giving the file path.</li>
<li>Arrays are converted into a Lua table with the elements in it as a list.</li>
<li>Points are converted into a Lua table with the fields <a href="../modules/ldtk.html#Level.x">x</a> and <a href="../modules/ldtk.html#Level.y">y</a>: <code>{ x=number, y=number }</code>.</li>
<li>Points are converted into a Lua table with the fields <a href="../modules/ldtk.html#Entity.x">x</a> and <a href="../modules/ldtk.html#Tile.y">y</a>, in pixels: <code>{ x=number, y=number }</code>.</li>
<li>Colors are converted into a Lua table with the red, green and blue components in [0-1] as a list: <code>{r,g,b}</code>.</li>
<li>Tiles are converted into a Lua table { tileset = associated tileset object, quad = associated quad } where <a href="../modules/ldtk.html#Tile.quad">quad</a> is a LÖVE Quad if LÖVE is available, otherwise a table <code>{ x, y, width, height }</code>.</li>
<li>EntityRef are converted into a Lua table { level = level, layerIid = layer IID, entityIid = entity IID, entity = see explanation }. If the entity being refernced belongs to another level and this level is not loaded, <code>entity</code> will be nil; otherwise (same level or the other level is also loaded), it will contain the entity.</li>
</ul>
@ -1930,7 +2170,7 @@ end
</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 2021-12-27 17:22:39 </i>
<i style="float:right;">Last updated 2022-09-16 20:07:07 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>