Skip to content

Commit

Permalink
fix up docs
Browse files Browse the repository at this point in the history
  • Loading branch information
straker committed Jan 9, 2020
1 parent 8ac71ea commit d6f547d
Show file tree
Hide file tree
Showing 31 changed files with 951 additions and 463 deletions.
40 changes: 20 additions & 20 deletions docs/api/animation.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,31 +152,31 @@ <h3 id="title-Animation"><span class="visually-hidden">Animation</span> Paramete
<code>properties</code>

</dt>
<dd><p>Object. Properties of the animation.</p>
<dd><p><em>Object</em>. Properties of the animation.</p>
</dd>
<dt>
<code>properties.spriteSheet</code>

</dt>
<dd><p><a href="api/spriteSheet">SpriteSheet</a>. Sprite sheet for the animation.</p>
<dd><p><em><a href="api/spriteSheet">SpriteSheet</a></em>. Sprite sheet for the animation.</p>
</dd>
<dt>
<code>properties.frames</code>

</dt>
<dd><p>An Array of Numbers. List of frames of the animation.</p>
<dd><p><em>An Array of Numbers</em>. List of frames of the animation.</p>
</dd>
<dt>
<code>properties.frameRate</code>

</dt>
<dd><p>Number. Number of frames to display in one second.</p>
<dd><p><em>Number</em>. Number of frames to display in one second.</p>
</dd>
<dt>
<code>properties.loop</code>
<span class="optional">Optional</span>
</dt>
<dd><p>Boolean. If the animation should loop. Defaults to <code>true</code>.</p>
<dd><p><em>Boolean</em>. If the animation should loop. Defaults to <code>true</code>.</p>
</dd>
</dl>

Expand Down Expand Up @@ -267,7 +267,7 @@ <h2 id="clone">
<p>Clone an animation so it can be used more than once. By default animations passed to <a href="api/sprite">Sprite</a> will be cloned so no two sprites update the same animation. Otherwise two sprites who shared the same animation would make it update twice as fast.</p>

<h3><span class="visually-hidden">clone</span> Return value</h3>
<p><p>A new Animation instance.</p>
<p><p><em><a href="api/animation">Animation</a></em>. A new Animation instance.</p>
</p>
</section>
<section>
Expand All @@ -278,7 +278,7 @@ <h2 id="frameRate">
</a>
</h2>

<p>Number. Number of frames to display per second. Adjusting this value will change the speed of the animation.</p>
<p><em>Number</em>. Number of frames to display per second. Adjusting this value will change the speed of the animation.</p>

</section>
<section>
Expand All @@ -289,7 +289,7 @@ <h2 id="frames">
</a>
</h2>

<p>An Array of Numbers. Sequence of frames to use from the sprite sheet.</p>
<p><em>An Array of Numbers</em>. Sequence of frames to use from the sprite sheet.</p>

</section>
<section>
Expand All @@ -300,7 +300,7 @@ <h2 id="height">
</a>
</h2>

<p>Number. The height of an individual frame. Taken from the property of the same name in the <a href="api/animation#spriteSheet">spriteSheet</a>.</p>
<p><em>Number</em>. The height of an individual frame. Taken from the property of the same name in the <a href="api/animation#spriteSheet">spriteSheet</a>.</p>

</section>
<section>
Expand All @@ -311,7 +311,7 @@ <h2 id="loop">
</a>
</h2>

<p>Boolean. If the animation should loop back to the beginning once completed.</p>
<p><em>Boolean</em>. If the animation should loop back to the beginning once completed.</p>

</section>
<section>
Expand All @@ -322,7 +322,7 @@ <h2 id="margin">
</a>
</h2>

<p>Number. The space between each frame. Taken from the property of the same name in the <a href="api/animation#spriteSheet">spriteSheet</a>.</p>
<p><em>Number</em>. The space between each frame. Taken from the property of the same name in the <a href="api/animation#spriteSheet">spriteSheet</a>.</p>

</section>
<section>
Expand All @@ -340,37 +340,37 @@ <h3 id="title-render"><span class="visually-hidden">render</span> Parameters</sp
<code>properties</code>

</dt>
<dd><p>Object. Properties to draw the animation.</p>
<dd><p><em>Object</em>. Properties to draw the animation.</p>
</dd>
<dt>
<code>properties.x</code>

</dt>
<dd><p>Number. X position to draw the animation.</p>
<dd><p><em>Number</em>. X position to draw the animation.</p>
</dd>
<dt>
<code>properties.y</code>

</dt>
<dd><p>Number. Y position to draw the animation.</p>
<dd><p><em>Number</em>. Y position to draw the animation.</p>
</dd>
<dt>
<code>properties.width</code>
<span class="optional">Optional</span>
</dt>
<dd><p>Number. width of the sprite. Defaults to <a href="api/animation#width">Animation.width</a>.</p>
<dd><p><em>Number</em>. width of the sprite. Defaults to <a href="api/animation#width">Animation.width</a>.</p>
</dd>
<dt>
<code>properties.height</code>
<span class="optional">Optional</span>
</dt>
<dd><p>Number. height of the sprite. Defaults to <a href="api/animation#height">Animation.height</a>.</p>
<dd><p><em>Number</em>. height of the sprite. Defaults to <a href="api/animation#height">Animation.height</a>.</p>
</dd>
<dt>
<code>properties.context</code>
<span class="optional">Optional</span>
</dt>
<dd><p>CanvasRenderingContext2D. The context the animation should draw to. Defaults to <a href="api/core#getContext">core.getContext()</a>.</p>
<dd><p><em>CanvasRenderingContext2D</em>. The context the animation should draw to. Defaults to <a href="api/core#getContext">core.getContext()</a>.</p>
</dd>
</dl>

Expand All @@ -394,7 +394,7 @@ <h2 id="spriteSheet">
</a>
</h2>

<p><a href="api/spriteSheet">SpriteSheet</a>. The sprite sheet to use for the animation.</p>
<p><em><a href="api/spriteSheet">SpriteSheet</a></em>. The sprite sheet to use for the animation.</p>

</section>
<section>
Expand All @@ -412,7 +412,7 @@ <h3 id="title-update"><span class="visually-hidden">update</span> Parameters</sp
<code>dt</code>
<span class="optional">Optional</span>
</dt>
<dd><p>Number. Time since last update. Defaults to <code>1/60</code>.</p>
<dd><p><em>Number</em>. Time since last update. Defaults to <code>1/60</code>.</p>
</dd>
</dl>

Expand All @@ -425,7 +425,7 @@ <h2 id="width">
</a>
</h2>

<p>Number. The width of an individual frame. Taken from the property of the same name in the <a href="api/animation#spriteSheet">spriteSheet</a>.</p>
<p><em>Number</em>. The width of an individual frame. Taken from the property of the same name in the <a href="api/animation#spriteSheet">spriteSheet</a>.</p>

</section>

Expand Down
28 changes: 14 additions & 14 deletions docs/api/assets.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ <h2 id="audioAssets">
</a>
</h2>

<p>Object. Object of all loaded audio assets by both file name and path. If the base <a href="api/assets#setAudioPath">audio path</a> was set before the audio was loaded, the file name and path will not include the base audio path.</p>
<p><em>Object</em>. Object of all loaded audio assets by both file name and path. If the base <a href="api/assets#setAudioPath">audio path</a> was set before the audio was loaded, the file name and path will not include the base audio path.</p>
<div class="tablist">
<ul role="tablist">
<li role="presentation" data-tab="global">
Expand Down Expand Up @@ -293,7 +293,7 @@ <h2 id="dataAssets">
</a>
</h2>

<p>Object. Object of all loaded data assets by both file name and path. If the base <a href="api/assets#setDataPath">data path</a> was set before the data was loaded, the file name and path will not include the base data path.</p>
<p><em>Object</em>. Object of all loaded data assets by both file name and path. If the base <a href="api/assets#setDataPath">data path</a> was set before the data was loaded, the file name and path will not include the base data path.</p>
<div class="tablist">
<ul role="tablist">
<li role="presentation" data-tab="global">
Expand Down Expand Up @@ -360,7 +360,7 @@ <h2 id="imageAssets">
</a>
</h2>

<p>Object. Object of all loaded image assets by both file name and path. If the base <a href="api/assets#setImagePath">image path</a> was set before the image was loaded, the file name and path will not include the base image path.</p>
<p><em>Object</em>. Object of all loaded image assets by both file name and path. If the base <a href="api/assets#setImagePath">image path</a> was set before the image was loaded, the file name and path will not include the base image path.</p>
<div class="tablist">
<ul role="tablist">
<li role="presentation" data-tab="global">
Expand Down Expand Up @@ -481,12 +481,12 @@ <h3 id="title-load"><span class="visually-hidden">load</span> Parameters</span><
<code>...urls</code>

</dt>
<dd><p>A list of Strings. Comma separated list of asset urls to load.</p>
<dd><p><em>A list of Strings</em>. Comma separated list of asset urls to load.</p>
</dd>
</dl>

<h3><span class="visually-hidden">load</span> Return value</h3>
<p><p>A deferred promise. Resolves with all the loaded assets.</p>
<p><p><em>Promise<an Array of anys></em>. A deferred promise. Resolves with all the loaded assets.</p>
</p>
</section>
<section>
Expand Down Expand Up @@ -549,12 +549,12 @@ <h3 id="title-loadAudio"><span class="visually-hidden">loadAudio</span> Paramete
<code>url</code>

</dt>
<dd><p>String. The URL to the Audio file.</p>
<dd><p><em>String</em>. The URL to the Audio file.</p>
</dd>
</dl>

<h3><span class="visually-hidden">loadAudio</span> Return value</h3>
<p><p>A deferred promise. Promise resolves with the Audio.</p>
<p><p><em>Promise<HTMLAudioElement></em>. A deferred promise. Promise resolves with the Audio.</p>
</p>
</section>
<section>
Expand Down Expand Up @@ -602,12 +602,12 @@ <h3 id="title-loadData"><span class="visually-hidden">loadData</span> Parameters
<code>url</code>

</dt>
<dd><p>String. The URL to the Data file.</p>
<dd><p><em>String</em>. The URL to the Data file.</p>
</dd>
</dl>

<h3><span class="visually-hidden">loadData</span> Return value</h3>
<p><p>A deferred promise. Promise resolves with the contents of the file. If the file is a JSON file, the contents will be parsed as JSON.</p>
<p><p><em>Promise</em>. A deferred promise. Promise resolves with the contents of the file. If the file is a JSON file, the contents will be parsed as JSON.</p>
</p>
</section>
<section>
Expand Down Expand Up @@ -655,12 +655,12 @@ <h3 id="title-loadImage"><span class="visually-hidden">loadImage</span> Paramete
<code>url</code>

</dt>
<dd><p>String. The URL to the Image file.</p>
<dd><p><em>String</em>. The URL to the Image file.</p>
</dd>
</dl>

<h3><span class="visually-hidden">loadImage</span> Return value</h3>
<p><p>A deferred promise. Promise resolves with the Image.</p>
<p><p><em>Promise<HTMLImageElement></em>. A deferred promise. Promise resolves with the Image.</p>
</p>
</section>
<section>
Expand Down Expand Up @@ -704,7 +704,7 @@ <h3 id="title-setAudioPath"><span class="visually-hidden">setAudioPath</span> Pa
<code>path</code>

</dt>
<dd><p>String. Base audio path.</p>
<dd><p><em>String</em>. Base audio path.</p>
</dd>
</dl>

Expand Down Expand Up @@ -750,7 +750,7 @@ <h3 id="title-setDataPath"><span class="visually-hidden">setDataPath</span> Para
<code>path</code>

</dt>
<dd><p>String. Base data path.</p>
<dd><p><em>String</em>. Base data path.</p>
</dd>
</dl>

Expand Down Expand Up @@ -796,7 +796,7 @@ <h3 id="title-setImagePath"><span class="visually-hidden">setImagePath</span> Pa
<code>path</code>

</dt>
<dd><p>String. Base image path.</p>
<dd><p><em>String</em>. Base image path.</p>
</dd>
</dl>

Expand Down
25 changes: 11 additions & 14 deletions docs/api/button.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ <h1>Button(&#8203;properties)
}
});

button.render();
```js</code></pre></section>
button.render();</code></pre></section>
<section role="tabpanel" aria-labelledby=button-es-tab data-tabpanel="es"><pre><code class="language-js">import { initPointer, Button } from 'path/to/kontra.mjs';
initPointer();

Expand All @@ -143,8 +142,7 @@ <h1>Button(&#8203;properties)
}
});

button.render();
```js</code></pre></section>
button.render();</code></pre></section>
<section role="tabpanel" aria-labelledby=button-bundle-tab data-tabpanel="bundle"><pre><code class="language-js">import { initPointer, Button } from &#39;kontra&#39;;
initPointer();

Expand All @@ -171,8 +169,7 @@ <h1>Button(&#8203;properties)
}
});

button.render();
```js</code></pre></section>
button.render();</code></pre></section>
</div>
<p><strong>Extends:</strong> <a href="api/text">Text</a></p>
<h3 id="title-Button"><span class="visually-hidden">Button</span> Parameters</span></h3>
Expand All @@ -181,37 +178,37 @@ <h3 id="title-Button"><span class="visually-hidden">Button</span> Parameters</sp
<code>properties</code>

</dt>
<dd><p>Object. Properties of the button (in addition to all Text properties).</p>
<dd><p><em>Object</em>. Properties of the button (in addition to all Text properties).</p>
</dd>
<dt>
<code>properties.onEnable</code>
<span class="optional">Optional</span>
</dt>
<dd><p>Function. Function called when the button is enabled.</p>
<dd><p><em>Function</em>. Function called when the button is enabled.</p>
</dd>
<dt>
<code>properties.onDisable</code>
<span class="optional">Optional</span>
</dt>
<dd><p>Function. Function called when the button is disabled.</p>
<dd><p><em>Function</em>. Function called when the button is disabled.</p>
</dd>
<dt>
<code>properties.onFocus</code>
<span class="optional">Optional</span>
</dt>
<dd><p>Function. Function called when the button is focused either by the pointer or keyboard.</p>
<dd><p><em>Function</em>. Function called when the button is focused either by the pointer or keyboard.</p>
</dd>
<dt>
<code>properties.onBlur</code>
<span class="optional">Optional</span>
</dt>
<dd><p>Function. Function called when the button losses focus either by the pointer or keyboard.</p>
<dd><p><em>Function</em>. Function called when the button losses focus either by the pointer or keyboard.</p>
</dd>
<dt>
<code>properties.onUp</code>
<span class="optional">Optional</span>
</dt>
<dd><p>Function. Function called when the button is clicked either by the pointer or keyboard.</p>
<dd><p><em>Function</em>. Function called when the button is clicked either by the pointer or keyboard.</p>
</dd>
</dl>

Expand Down Expand Up @@ -332,7 +329,7 @@ <h2 id="disabled">
</a>
</h2>

<p>Boolean. If the button is disabled.</p>
<p><em>Boolean</em>. If the button is disabled.</p>

</section>
<section>
Expand Down Expand Up @@ -365,7 +362,7 @@ <h2 id="focused">
</a>
</h2>

<p>Boolean. If the button is focused.</p>
<p><em>Boolean</em>. If the button is focused.</p>

</section>
<section>
Expand Down
6 changes: 3 additions & 3 deletions docs/api/collision.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,18 +190,18 @@ <h3 id="title-collides"><span class="visually-hidden">collides</span> Parameters
<code>object1</code>

</dt>
<dd><p>Object. Object reference.</p>
<dd><p><em>Object</em>. Object reference.</p>
</dd>
<dt>
<code>object2</code>

</dt>
<dd><p>Object. Object to check collision against.</p>
<dd><p><em>Object</em>. Object to check collision against.</p>
</dd>
</dl>

<h3><span class="visually-hidden">collides</span> Return value</h3>
<p><p><code>true</code> if the objects collide, <code>false</code> otherwise. Will return <code>null</code> if the either of the two objects are rotated.</p>
<p><p><em>Boolean or null</em>. <code>true</code> if the objects collide, <code>false</code> otherwise. Will return <code>null</code> if the either of the two objects are rotated.</p>
</p>
</section>

Expand Down

0 comments on commit d6f547d

Please sign in to comment.