Skip to content

Commit

Permalink
Merge 39584c3 into c82c9d6
Browse files Browse the repository at this point in the history
  • Loading branch information
straker committed Dec 28, 2019
2 parents c82c9d6 + 39584c3 commit eb80881
Show file tree
Hide file tree
Showing 54 changed files with 2,195 additions and 282 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,5 +4,6 @@ coverage
test/permutations/*.js
test/permutations/*.spec.js
test/typings/*.js
test/playground.html

!test/permutations/index.js
8 changes: 7 additions & 1 deletion CONTRIBUTING.md
Expand Up @@ -28,7 +28,13 @@ To build the development code, run `npm run build`. To build the distribution ve

## Testing

Please add unit and/or integration tests for all new changes. To run the tests, run `npm test`.
Please add unit and/or integration tests for all new changes, as well as TypeScript tests found in [test/typings](test/typings). To run the tests, run `npm test`.

The TypeScript tests just ensure that the TypesCript declaration file is correct and doesn't miss any obvious use cases with the various APIs.

## Exports

Please update the export files for all new changes (if need be). [kontra.defaults.js](src/kontra.defaults.js) imports all functionality and then adds it to the `kontra` object. [kontra.js](src/kontra.js) exports all functionality directly. You will also need to tests to their respected spec files that ensures the functionality is exported.

## Documentation and TypeScript Declaration File

Expand Down
15 changes: 8 additions & 7 deletions docs/api/animation.html
Expand Up @@ -53,6 +53,7 @@
<li><a href="api/pointer" >Pointer</a></li>
<li><a href="api/pool" >Pool</a></li>
<li><a href="api/quadtree" >Quadtree</a></li>
<li><a href="api/scene" >Scene</a></li>
<li><a href="api/sprite" >Sprite</a></li>
<li><a href="api/spriteSheet" >SpriteSheet</a></li>
<li><a href="api/store" >Store</a></li>
Expand Down Expand Up @@ -276,7 +277,7 @@ <h2 id="frameRate">
</a>
</h2>

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

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

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

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

<p>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>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>

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

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

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

<p>The space between each frame. Taken from the property of the same name in the <a href="api/animation#spriteSheet">spriteSheet</a>.</p>
<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>

</section>
<section>
Expand Down Expand Up @@ -392,7 +393,7 @@ <h2 id="spriteSheet">
</a>
</h2>

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

</section>
<section>
Expand Down Expand Up @@ -423,7 +424,7 @@ <h2 id="width">
</a>
</h2>

<p>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>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>

</section>

Expand Down
7 changes: 4 additions & 3 deletions docs/api/assets.html
Expand Up @@ -53,6 +53,7 @@
<li><a href="api/pointer" >Pointer</a></li>
<li><a href="api/pool" >Pool</a></li>
<li><a href="api/quadtree" >Quadtree</a></li>
<li><a href="api/scene" >Scene</a></li>
<li><a href="api/sprite" >Sprite</a></li>
<li><a href="api/spriteSheet" >SpriteSheet</a></li>
<li><a href="api/store" >Store</a></li>
Expand Down Expand Up @@ -224,7 +225,7 @@ <h2 id="audioAssets">
</a>
</h2>

<p>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>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>
<div class="tablist">
<ul role="tablist">
<li role="presentation" data-tab="global">
Expand Down Expand Up @@ -291,7 +292,7 @@ <h2 id="dataAssets">
</a>
</h2>

<p>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>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>
<div class="tablist">
<ul role="tablist">
<li role="presentation" data-tab="global">
Expand Down Expand Up @@ -358,7 +359,7 @@ <h2 id="imageAssets">
</a>
</h2>

<p>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>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>
<div class="tablist">
<ul role="tablist">
<li role="presentation" data-tab="global">
Expand Down
99 changes: 82 additions & 17 deletions docs/api/button.html
Expand Up @@ -53,6 +53,7 @@
<li><a href="api/pointer" >Pointer</a></li>
<li><a href="api/pool" >Pool</a></li>
<li><a href="api/quadtree" >Quadtree</a></li>
<li><a href="api/scene" >Scene</a></li>
<li><a href="api/sprite" >Sprite</a></li>
<li><a href="api/spriteSheet" >SpriteSheet</a></li>
<li><a href="api/store" >Store</a></li>
Expand Down Expand Up @@ -242,13 +243,13 @@ <h3 id="properties">Properties</h3>
<h3 id="methods">Methods</h3>
<ul aria-labelledby="methods">
<li>
<a href="api/button#Destroy">
<span>Button&#8203;.Destroy(&#8203;)</span>
<a href="api/button#blur">
<span>Button&#8203;.blur(&#8203;)</span>
</a>
</li>
<li>
<a href="api/button#blur">
<span>Button&#8203;.blur(&#8203;)</span>
<a href="api/button#destroy">
<span>Button&#8203;.destroy(&#8203;)</span>
</a>
</li>
<li>
Expand All @@ -266,32 +267,52 @@ <h3 id="methods">Methods</h3>
<span>Button&#8203;.focus(&#8203;)</span>
</a>
</li>
<li>
<a href="api/button#onBlur">
<span>Button&#8203;.onBlur(&#8203;)</span>
</a>
</li>
<li>
<a href="api/button#onDisable">
<span>Button&#8203;.onDisable(&#8203;)</span>
</a>
</li>
<li>
<a href="api/button#onEnable">
<span>Button&#8203;.onEnable(&#8203;)</span>
</a>
</li>
<li>
<a href="api/button#onFocus">
<span>Button&#8203;.onFocus(&#8203;)</span>
</a>
</li>
</ul>
</li>
</ul>
</section>


<section>
<h2 id="Destroy">
<a href="api/button#Destroy" class="section-link">
<span>Button&#8203;.Destroy(&#8203;)</span>
<h2 id="blur">
<a href="api/button#blur" class="section-link">
<span>Button&#8203;.blur(&#8203;)</span>
<span aria-hidden="true">#</span>
</a>
</h2>

<p>Clean up the button.</p>
<p>Blur the button. Calls <a href="/api/button#onBlur">onBlur</a> if passed.</p>

</section>
<section>
<h2 id="blur">
<a href="api/button#blur" class="section-link">
<span>Button&#8203;.blur(&#8203;)</span>
<h2 id="destroy">
<a href="api/button#destroy" class="section-link">
<span>Button&#8203;.destroy(&#8203;)</span>
<span aria-hidden="true">#</span>
</a>
</h2>

<p>Blur the button.</p>
<p>Clean up the button.</p>

</section>
<section>
Expand All @@ -302,7 +323,7 @@ <h2 id="disable">
</a>
</h2>

<p>Disable the button.</p>
<p>Disable the button. Calls <a href="/api/button#onDisable">onDisable</a> if passed.</p>

</section>
<section>
Expand All @@ -313,7 +334,7 @@ <h2 id="disabled">
</a>
</h2>

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

</section>
<section>
Expand All @@ -324,7 +345,7 @@ <h2 id="enable">
</a>
</h2>

<p>Enable the button.</p>
<p>Enable the button. Calls <a href="/api/button#onEnable">onEnable</a> if passed.</p>

</section>
<section>
Expand All @@ -335,7 +356,7 @@ <h2 id="focus">
</a>
</h2>

<p>Focus the button.</p>
<p>Focus the button. Calls <a href="/api/button#onFOcus">onFOcus</a> if passed.</p>

</section>
<section>
Expand All @@ -346,7 +367,51 @@ <h2 id="focused">
</a>
</h2>

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

</section>
<section>
<h2 id="onBlur">
<a href="api/button#onBlur" class="section-link">
<span>Button&#8203;.onBlur(&#8203;)</span>
<span aria-hidden="true">#</span>
</a>
</h2>

<p>Function called when then button is blurred. Override this function to have the button do something when blurred.</p>

</section>
<section>
<h2 id="onDisable">
<a href="api/button#onDisable" class="section-link">
<span>Button&#8203;.onDisable(&#8203;)</span>
<span aria-hidden="true">#</span>
</a>
</h2>

<p>Function called when then button is disabled. Override this function to have the button do something when disabled.</p>

</section>
<section>
<h2 id="onEnable">
<a href="api/button#onEnable" class="section-link">
<span>Button&#8203;.onEnable(&#8203;)</span>
<span aria-hidden="true">#</span>
</a>
</h2>

<p>Function called when then button is enabled. Override this function to have the button do something when enabled.</p>

</section>
<section>
<h2 id="onFocus">
<a href="api/button#onFocus" class="section-link">
<span>Button&#8203;.onFocus(&#8203;)</span>
<span aria-hidden="true">#</span>
</a>
</h2>

<p>Function called when then button is focused. Override this function to have the button do something when focused.</p>

</section>

Expand Down
1 change: 1 addition & 0 deletions docs/api/collision.html
Expand Up @@ -53,6 +53,7 @@
<li><a href="api/pointer" >Pointer</a></li>
<li><a href="api/pool" >Pool</a></li>
<li><a href="api/quadtree" >Quadtree</a></li>
<li><a href="api/scene" >Scene</a></li>
<li><a href="api/sprite" >Sprite</a></li>
<li><a href="api/spriteSheet" >SpriteSheet</a></li>
<li><a href="api/store" >Store</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/api/core.html
Expand Up @@ -53,6 +53,7 @@
<li><a href="api/pointer" >Pointer</a></li>
<li><a href="api/pool" >Pool</a></li>
<li><a href="api/quadtree" >Quadtree</a></li>
<li><a href="api/scene" >Scene</a></li>
<li><a href="api/sprite" >Sprite</a></li>
<li><a href="api/spriteSheet" >SpriteSheet</a></li>
<li><a href="api/store" >Store</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/api/events.html
Expand Up @@ -53,6 +53,7 @@
<li><a href="api/pointer" >Pointer</a></li>
<li><a href="api/pool" >Pool</a></li>
<li><a href="api/quadtree" >Quadtree</a></li>
<li><a href="api/scene" >Scene</a></li>
<li><a href="api/sprite" >Sprite</a></li>
<li><a href="api/spriteSheet" >SpriteSheet</a></li>
<li><a href="api/store" >Store</a></li>
Expand Down
3 changes: 2 additions & 1 deletion docs/api/gameLoop.html
Expand Up @@ -53,6 +53,7 @@
<li><a href="api/pointer" >Pointer</a></li>
<li><a href="api/pool" >Pool</a></li>
<li><a href="api/quadtree" >Quadtree</a></li>
<li><a href="api/scene" >Scene</a></li>
<li><a href="api/sprite" >Sprite</a></li>
<li><a href="api/spriteSheet" >SpriteSheet</a></li>
<li><a href="api/store" >Store</a></li>
Expand Down Expand Up @@ -256,7 +257,7 @@ <h2 id="isStopped">
</a>
</h2>

<p>If the game loop is currently stopped.</p>
<p>Boolean. If the game loop is currently stopped.</p>
<div class="tablist">
<ul role="tablist">
<li role="presentation" data-tab="global">
Expand Down

0 comments on commit eb80881

Please sign in to comment.