Skip to content

Commit

Permalink
Merge 6b90d64 into 4e62274
Browse files Browse the repository at this point in the history
  • Loading branch information
straker committed Aug 24, 2019
2 parents 4e62274 + 6b90d64 commit 1855aef
Show file tree
Hide file tree
Showing 14 changed files with 723 additions and 81 deletions.
66 changes: 65 additions & 1 deletion docs/api/sprite.html
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,16 @@ <h3 id="properties">Properties</h3>
<span>Sprite&#8203;.rotation</span>
</a>
</li>
<li>
<a href="api/sprite#sx">
<span>Sprite&#8203;.sx</span>
</a>
</li>
<li>
<a href="api/sprite#sy">
<span>Sprite&#8203;.sy</span>
</a>
</li>
<li>
<a href="api/sprite#ttl">
<span>Sprite&#8203;.ttl</span>
Expand All @@ -285,6 +295,16 @@ <h3 id="properties">Properties</h3>
<span>Sprite&#8203;.velocity</span>
</a>
</li>
<li>
<a href="api/sprite#viewX">
<span>Sprite&#8203;.viewX</span>
</a>
</li>
<li>
<a href="api/sprite#viewY">
<span>Sprite&#8203;.viewY</span>
</a>
</li>
<li>
<a href="api/sprite#width">
<span>Sprite&#8203;.width</span>
Expand Down Expand Up @@ -1815,7 +1835,7 @@ <h2 id="position">
</a>
</h2>

<p>The sprites position vector.</p>
<p>The sprites position vector. The sprites position is its position in the world, as opposed to the position in the <a href="#viewX">viewport</a>. Typically the position in the world and the viewport are the same value. If the sprite has been <a href="/api/tileEngine#addObject">added to a tileEngine</a>, the position vector represents where in the tile world the sprite is while the viewport represents where to draw the sprite in relation to the top-left corner of the canvas.</p>

</section>
<section>
Expand All @@ -1839,6 +1859,28 @@ <h2 id="rotation">

<p>The rotation of the sprite around the origin in radians.</p>

</section>
<section>
<h2 id="sx">
<a href="api/sprite#sx" class="section-link">
<span>Sprite&#8203;.sx</span>
<span aria-hidden="true">#</span>
</a>
</h2>

<p>The X coordinate of the camera. Used to determine <a href="#viewX">viewX</a>.</p>

</section>
<section>
<h2 id="sy">
<a href="api/sprite#sy" class="section-link">
<span>Sprite&#8203;.sy</span>
<span aria-hidden="true">#</span>
</a>
</h2>

<p>The Y coordinate of the camera. Used to determine <a href="#viewY">viewY</a>.</p>

</section>
<section>
<h2 id="ttl">
Expand Down Expand Up @@ -1881,6 +1923,28 @@ <h2 id="velocity">

<p>The sprites velocity vector.</p>

</section>
<section>
<h2 id="viewX">
<a href="api/sprite#viewX" class="section-link">
<span>Sprite&#8203;.viewX</span>
<span aria-hidden="true">#</span>
</a>
</h2>

<p>Readonly. X coordinate of where to draw the sprite. Typically the same value of the <a href="#position">position vector</a> unless the sprite has been added to a tileEngine.</p>

</section>
<section>
<h2 id="viewY">
<a href="api/sprite#viewY" class="section-link">
<span>Sprite&#8203;.viewY</span>
<span aria-hidden="true">#</span>
</a>
</h2>

<p>Readonly. Y coordinate of where to draw the sprite. Typically the same value of the <a href="#position">position vector</a> unless the sprite has been added to a tileEngine.</p>

</section>
<section>
<h2 id="width">
Expand Down
50 changes: 50 additions & 0 deletions docs/api/tileEngine.html
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,21 @@ <h3 id="properties">Properties</h3>
<li>
<h3 id="methods">Methods</h3>
<ul aria-labelledby="methods">
<li>
<a href="api/tileEngine#addObject">
<span>TileEngine&#8203;.addObject(&#8203;object)</span>
</a>
</li>
<li>
<a href="api/tileEngine#layerCollidesWith">
<span>TileEngine&#8203;.layerCollidesWith(&#8203;name, object)</span>
</a>
</li>
<li>
<a href="api/tileEngine#removeObject">
<span>TileEngine&#8203;.removeObject(&#8203;object)</span>
</a>
</li>
<li>
<a href="api/tileEngine#render">
<span>TileEngine&#8203;.render(&#8203;)</span>
Expand Down Expand Up @@ -705,6 +715,26 @@ <h2 id="moving-the camera">
});
})();</script> </section>

<section>
<h2 id="addObject">
<a href="api/tileEngine#addObject" class="section-link">
<span>TileEngine&#8203;.addObject(&#8203;object)</span>
<span aria-hidden="true">#</span>
</a>
</h2>

<p>Add an object to the tile engine. The tile engine will set the objects camera position (<code>sx</code>, <code>sy</code>) to be in sync with the tile engine camera.</p>
<h3 id="title-addObject"><span class="visually-hidden">addObject</span> Parameters</span></h3>
<dl aria-labelledby="title-addObject">
<dt>
<code>object</code>

</dt>
<dd><p>Object. Object to add to the tile engine.</p>
</dd>
</dl>

</section>
<section>
<h2 id="context">
<a href="api/tileEngine#context" class="section-link">
Expand Down Expand Up @@ -895,6 +925,26 @@ <h2 id="mapwidth">

<p>The width of the tile map (in pixels).</p>

</section>
<section>
<h2 id="removeObject">
<a href="api/tileEngine#removeObject" class="section-link">
<span>TileEngine&#8203;.removeObject(&#8203;object)</span>
<span aria-hidden="true">#</span>
</a>
</h2>

<p>Remove an object from the tile engine.</p>
<h3 id="title-removeObject"><span class="visually-hidden">removeObject</span> Parameters</span></h3>
<dl aria-labelledby="title-removeObject">
<dt>
<code>object</code>

</dt>
<dd><p>Object. Object to remove from the tile engine.</p>
</dd>
</dl>

</section>
<section>
<h2 id="render">
Expand Down

0 comments on commit 1855aef

Please sign in to comment.