Skip to content

Commit

Permalink
Docs update.
Browse files Browse the repository at this point in the history
  • Loading branch information
photonstorm committed Apr 29, 2014
1 parent 9fd4ac5 commit ba3f635
Show file tree
Hide file tree
Showing 223 changed files with 33,893 additions and 3,939 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ There is an extensive [Migration Guide](https://github.com/photonstorm/phaser/bl
* Tilemap.addTilesetImage will now raise a console.warn if you specify an invalid tileset key and not create the tileset rather than pick the default set.
* Math.smoothstep and Math.smootherstep have been updated to work regardless if a is > or < b (thanks @gre, fix #772)
* Text.updateText now sets the lineCap to `round` to avoid occassional font glitching issues in Chrome.
* Loader now uses XDomainRequest in IE9 to load JSON data to help with CORS issues.

### New Features

Expand Down
6 changes: 5 additions & 1 deletion docs/AABB.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
<a href="Phaser.AnimationParser.html">AnimationParser</a>
</li>

<li class="class-depth-1">
<a href="Phaser.ArrayList.html">ArrayList</a>
</li>

<li class="class-depth-1">
<a href="Phaser.BitmapData.html">BitmapData</a>
</li>
Expand Down Expand Up @@ -1544,7 +1548,7 @@ <h1 class="page-title">Source: physics/ninja/AABB.js</h1>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Tue Apr 15 2014 02:52:21 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
on Tue Apr 29 2014 14:51:16 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
Expand Down
72 changes: 67 additions & 5 deletions docs/Animation.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
<a href="Phaser.AnimationParser.html">AnimationParser</a>
</li>

<li class="class-depth-1">
<a href="Phaser.ArrayList.html">ArrayList</a>
</li>

<li class="class-depth-1">
<a href="Phaser.BitmapData.html">BitmapData</a>
</li>
Expand Down Expand Up @@ -740,6 +744,64 @@ <h1 class="page-title">Source: animation/Animation.js</h1>

},

/**
* Sets this animations playback to a given frame with the given ID.
*
* @method Phaser.Animation#setFrame
* @param {string|number} [frameId] - The identifier of the frame to set. Can be the name of the frame, the sprite index of the frame, or the animation-local frame index.
* @param {boolean} [useLocalFrameIndex=false] - If you provide a number for frameId, should it use the numeric indexes of the frameData, or the 0-indexed frame index local to the animation.
*/
setFrame: function(frameId, useLocalFrameIndex) {

var frameIndex;

if (typeof useLocalFrameIndex === 'undefined')
{
useLocalFrameIndex = false;
}

// Find the index to the desired frame.
if (typeof frameId === "string")
{
for (var i = 0; i &lt; this._frames.length; i++)
{
if (this._frameData.getFrame(this._frames[i]).name === frameId)
{
frameIndex = i;
}
}
}
else if (typeof frameId === "number")
{
if (useLocalFrameIndex)
{
frameIndex = frameId;
}
else
{
for (var i = 0; i &lt; this._frames.length; i++)
{
if (this.frames[i] === frameIndex)
{
frameIndex = i;
}
}
}
}

if (frameIndex)
{
// Set the current frame index to the found index. Subtract 1 so that it animates to the desired frame on update.
this._frameIndex = frameIndex - 1;

// Make the animation update at next update
this._timeNextFrame = this.game.time.now;

this.update();
}

},

/**
* Stops playback of this animation and set it to a finished state. If a resetFrame is provided it will stop playback and set frame to the first in the animation.
* If `dispatchComplete` is true it will dispatch the complete events, otherwise they'll be ignored.
Expand Down Expand Up @@ -888,7 +950,9 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
* @method Phaser.Animation#destroy
*/
destroy: function () {

this.game.onPause.remove(this.onPause, this);
this.game.onResume.remove(this.onResume, this);

this.game = null;
this._parent = null;
this._frames = null;
Expand All @@ -900,9 +964,6 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
this.onLoop.dispose();
this.onComplete.dispose();

this.game.onPause.remove(this.onPause, this);
this.game.onResume.remove(this.onResume, this);

},

/**
Expand Down Expand Up @@ -1046,6 +1107,7 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
* @param {number} stop - The number to count to. If your frames are named 'explosion_0001' to 'explosion_0034' the stop value is 34.
* @param {string} [suffix=''] - The end of the filename. If the filename was 'explosion_0001-large' the prefix would be '-large'.
* @param {number} [zeroPad=0] - The number of zeroes to pad the min and max values with. If your frames are named 'explosion_0001' to 'explosion_0034' then the zeroPad is 4.
* @return {array} An array of framenames.
*/
Phaser.Animation.generateFrameNames = function (prefix, start, stop, suffix, zeroPad) {

Expand Down Expand Up @@ -1117,7 +1179,7 @@ <h1 class="page-title">Source: animation/Animation.js</h1>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Tue Apr 15 2014 02:52:21 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
on Tue Apr 29 2014 14:51:16 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
Expand Down
12 changes: 11 additions & 1 deletion docs/AnimationManager.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
<a href="Phaser.AnimationParser.html">AnimationParser</a>
</li>

<li class="class-depth-1">
<a href="Phaser.ArrayList.html">ArrayList</a>
</li>

<li class="class-depth-1">
<a href="Phaser.BitmapData.html">BitmapData</a>
</li>
Expand Down Expand Up @@ -547,6 +551,12 @@ <h1 class="page-title">Source: animation/AnimationManager.js</h1>
*/
this.currentFrame = null;

/**
* @property {Phaser.Animation} currentAnim - The currently displayed animation, if any.
* @default
*/
this.currentAnim = null;

/**
* @property {boolean} updateIfVisible - Should the animation data continue to update even if the Sprite.visible is set to false.
* @default
Expand Down Expand Up @@ -1010,7 +1020,7 @@ <h1 class="page-title">Source: animation/AnimationManager.js</h1>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Tue Apr 15 2014 02:52:21 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
on Tue Apr 29 2014 14:51:16 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
Expand Down
6 changes: 5 additions & 1 deletion docs/AnimationParser.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
<a href="Phaser.AnimationParser.html">AnimationParser</a>
</li>

<li class="class-depth-1">
<a href="Phaser.ArrayList.html">ArrayList</a>
</li>

<li class="class-depth-1">
<a href="Phaser.BitmapData.html">BitmapData</a>
</li>
Expand Down Expand Up @@ -851,7 +855,7 @@ <h1 class="page-title">Source: animation/AnimationParser.js</h1>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Tue Apr 15 2014 02:52:21 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
on Tue Apr 29 2014 14:51:16 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
Expand Down
Loading

0 comments on commit ba3f635

Please sign in to comment.