Skip to content

Commit ba3f635

Browse files
committed
Docs update.
1 parent 9fd4ac5 commit ba3f635

223 files changed

Lines changed: 33893 additions & 3939 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ There is an extensive [Migration Guide](https://github.com/photonstorm/phaser/bl
3131
* 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.
3232
* Math.smoothstep and Math.smootherstep have been updated to work regardless if a is > or < b (thanks @gre, fix #772)
3333
* Text.updateText now sets the lineCap to `round` to avoid occassional font glitching issues in Chrome.
34+
* Loader now uses XDomainRequest in IE9 to load JSON data to help with CORS issues.
3435

3536
### New Features
3637

docs/AABB.js.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
<a href="Phaser.AnimationParser.html">AnimationParser</a>
5555
</li>
5656

57+
<li class="class-depth-1">
58+
<a href="Phaser.ArrayList.html">ArrayList</a>
59+
</li>
60+
5761
<li class="class-depth-1">
5862
<a href="Phaser.BitmapData.html">BitmapData</a>
5963
</li>
@@ -1544,7 +1548,7 @@ <h1 class="page-title">Source: physics/ninja/AABB.js</h1>
15441548

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

docs/Animation.js.html

Lines changed: 67 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
<a href="Phaser.AnimationParser.html">AnimationParser</a>
5555
</li>
5656

57+
<li class="class-depth-1">
58+
<a href="Phaser.ArrayList.html">ArrayList</a>
59+
</li>
60+
5761
<li class="class-depth-1">
5862
<a href="Phaser.BitmapData.html">BitmapData</a>
5963
</li>
@@ -740,6 +744,64 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
740744

741745
},
742746

747+
/**
748+
* Sets this animations playback to a given frame with the given ID.
749+
*
750+
* @method Phaser.Animation#setFrame
751+
* @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.
752+
* @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.
753+
*/
754+
setFrame: function(frameId, useLocalFrameIndex) {
755+
756+
var frameIndex;
757+
758+
if (typeof useLocalFrameIndex === 'undefined')
759+
{
760+
useLocalFrameIndex = false;
761+
}
762+
763+
// Find the index to the desired frame.
764+
if (typeof frameId === "string")
765+
{
766+
for (var i = 0; i &lt; this._frames.length; i++)
767+
{
768+
if (this._frameData.getFrame(this._frames[i]).name === frameId)
769+
{
770+
frameIndex = i;
771+
}
772+
}
773+
}
774+
else if (typeof frameId === "number")
775+
{
776+
if (useLocalFrameIndex)
777+
{
778+
frameIndex = frameId;
779+
}
780+
else
781+
{
782+
for (var i = 0; i &lt; this._frames.length; i++)
783+
{
784+
if (this.frames[i] === frameIndex)
785+
{
786+
frameIndex = i;
787+
}
788+
}
789+
}
790+
}
791+
792+
if (frameIndex)
793+
{
794+
// Set the current frame index to the found index. Subtract 1 so that it animates to the desired frame on update.
795+
this._frameIndex = frameIndex - 1;
796+
797+
// Make the animation update at next update
798+
this._timeNextFrame = this.game.time.now;
799+
800+
this.update();
801+
}
802+
803+
},
804+
743805
/**
744806
* 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.
745807
* If `dispatchComplete` is true it will dispatch the complete events, otherwise they'll be ignored.
@@ -888,7 +950,9 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
888950
* @method Phaser.Animation#destroy
889951
*/
890952
destroy: function () {
891-
953+
this.game.onPause.remove(this.onPause, this);
954+
this.game.onResume.remove(this.onResume, this);
955+
892956
this.game = null;
893957
this._parent = null;
894958
this._frames = null;
@@ -900,9 +964,6 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
900964
this.onLoop.dispose();
901965
this.onComplete.dispose();
902966

903-
this.game.onPause.remove(this.onPause, this);
904-
this.game.onResume.remove(this.onResume, this);
905-
906967
},
907968

908969
/**
@@ -1046,6 +1107,7 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
10461107
* @param {number} stop - The number to count to. If your frames are named 'explosion_0001' to 'explosion_0034' the stop value is 34.
10471108
* @param {string} [suffix=''] - The end of the filename. If the filename was 'explosion_0001-large' the prefix would be '-large'.
10481109
* @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.
1110+
* @return {array} An array of framenames.
10491111
*/
10501112
Phaser.Animation.generateFrameNames = function (prefix, start, stop, suffix, zeroPad) {
10511113

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

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

docs/AnimationManager.js.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
<a href="Phaser.AnimationParser.html">AnimationParser</a>
5555
</li>
5656

57+
<li class="class-depth-1">
58+
<a href="Phaser.ArrayList.html">ArrayList</a>
59+
</li>
60+
5761
<li class="class-depth-1">
5862
<a href="Phaser.BitmapData.html">BitmapData</a>
5963
</li>
@@ -547,6 +551,12 @@ <h1 class="page-title">Source: animation/AnimationManager.js</h1>
547551
*/
548552
this.currentFrame = null;
549553

554+
/**
555+
* @property {Phaser.Animation} currentAnim - The currently displayed animation, if any.
556+
* @default
557+
*/
558+
this.currentAnim = null;
559+
550560
/**
551561
* @property {boolean} updateIfVisible - Should the animation data continue to update even if the Sprite.visible is set to false.
552562
* @default
@@ -1010,7 +1020,7 @@ <h1 class="page-title">Source: animation/AnimationManager.js</h1>
10101020

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

docs/AnimationParser.js.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
<a href="Phaser.AnimationParser.html">AnimationParser</a>
5555
</li>
5656

57+
<li class="class-depth-1">
58+
<a href="Phaser.ArrayList.html">ArrayList</a>
59+
</li>
60+
5761
<li class="class-depth-1">
5862
<a href="Phaser.BitmapData.html">BitmapData</a>
5963
</li>
@@ -851,7 +855,7 @@ <h1 class="page-title">Source: animation/AnimationParser.js</h1>
851855

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

0 commit comments

Comments
 (0)