Skip to content

Commit 4259a9a

Browse files
committed
Republished docs.
1 parent 43c8a25 commit 4259a9a

223 files changed

Lines changed: 16171 additions & 3942 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.

docs/AABB.js.html

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,8 +1525,33 @@ <h1 class="page-title">Source: physics/ninja/AABB.js</h1>
15251525
destroy: function() {
15261526
this.body = null;
15271527
this.system = null;
1528-
}
1528+
},
1529+
1530+
/**
1531+
* Render this AABB for debugging purposes.
1532+
*
1533+
* @method Phaser.Physics.Ninja.AABB#render
1534+
* @param {object} context - The context to render to.
1535+
* @param {number} xOffset - X offset from AABB's position to render at.
1536+
* @param {number} yOffset - Y offset from AABB's position to render at.
1537+
* @param {string} color - color of the debug shape to be rendered. (format is css color string).
1538+
* @param {boolean} filled - Render the shape as solid (true) or hollow (false).
1539+
*/
1540+
render: function(context, xOffset, yOffset, color, filled) {
1541+
var left = this.pos.x - this.xw - xOffset;
1542+
var top = this.pos.y - this.yw - yOffset;
15291543

1544+
if (filled)
1545+
{
1546+
context.fillStyle = color;
1547+
context.fillRect(left, top, this.width, this.height);
1548+
}
1549+
else
1550+
{
1551+
context.strokeStyle = color;
1552+
context.strokeRect(left, top, this.width, this.height);
1553+
}
1554+
}
15301555
};
15311556
</pre>
15321557
</article>
@@ -1549,7 +1574,7 @@ <h1 class="page-title">Source: physics/ninja/AABB.js</h1>
15491574

15501575
<span class="jsdoc-message">
15511576
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
1552-
on Tue May 20 2014 10:05:49 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
1577+
on Thu Jul 10 2014 20:18:55 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
15531578
</span>
15541579
</footer>
15551580
</div>

docs/Animation.js.html

Lines changed: 106 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,8 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
706706
this._frameIndex = 0;
707707

708708
this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);
709-
this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]);
709+
710+
this._parent.setFrame(this.currentFrame);
710711

711712
// TODO: Double check if required
712713
if (this._parent.__tilePattern)
@@ -716,6 +717,7 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
716717
}
717718

718719
this._parent.events.onAnimationStart.dispatch(this._parent, this);
720+
719721
this.onStart.dispatch(this._parent, this);
720722

721723
return this;
@@ -741,6 +743,8 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
741743

742744
this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);
743745

746+
this._parent.setFrame(this.currentFrame);
747+
744748
this.onStart.dispatch(this._parent, this);
745749

746750
},
@@ -823,6 +827,7 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
823827
if (resetFrame)
824828
{
825829
this.currentFrame = this._frameData.getFrame(this._frames[0]);
830+
this._parent.setFrame(this.currentFrame);
826831
}
827832

828833
if (dispatchComplete)
@@ -873,7 +878,7 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
873878
return false;
874879
}
875880

876-
if (this.isPlaying === true && this.game.time.now >= this._timeNextFrame)
881+
if (this.isPlaying && this.game.time.now >= this._timeNextFrame)
877882
{
878883
this._frameSkip = 1;
879884

@@ -886,7 +891,6 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
886891
{
887892
// We need to skip a frame, work out how many
888893
this._frameSkip = Math.floor(this._frameDiff / this.delay);
889-
890894
this._frameDiff -= (this._frameSkip * this.delay);
891895
}
892896

@@ -901,18 +905,6 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
901905
{
902906
this._frameIndex %= this._frames.length;
903907
this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);
904-
905-
if (this.currentFrame)
906-
{
907-
this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]);
908-
909-
if (this._parent.__tilePattern)
910-
{
911-
this._parent.__tilePattern = false;
912-
this._parent.tilingTexture = false;
913-
}
914-
}
915-
916908
this.loopCount++;
917909
this._parent.events.onAnimationLoop.dispatch(this._parent, this);
918910
this.onLoop.dispatch(this._parent, this);
@@ -922,19 +914,17 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
922914
this.complete();
923915
}
924916
}
925-
else
917+
918+
this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);
919+
920+
if (this.currentFrame)
926921
{
927-
this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);
922+
this._parent.setFrame(this.currentFrame);
928923

929-
if (this.currentFrame)
924+
if (this._parent.__tilePattern)
930925
{
931-
this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]);
932-
933-
if (this._parent.__tilePattern)
934-
{
935-
this._parent.__tilePattern = false;
936-
this._parent.tilingTexture = false;
937-
}
926+
this._parent.__tilePattern = false;
927+
this._parent.tilingTexture = false;
938928
}
939929
}
940930

@@ -945,12 +935,101 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
945935

946936
},
947937

938+
/**
939+
* Advances by the given number of frames in the Animation, taking the loop value into consideration.
940+
*
941+
* @method Phaser.Animation#next
942+
* @param {number} [quantity=1] - The number of frames to advance.
943+
*/
944+
next: function (quantity) {
945+
946+
if (typeof quantity === 'undefined') { quantity = 1; }
947+
948+
var frame = this._frameIndex + quantity;
949+
950+
if (frame >= this._frames.length)
951+
{
952+
if (this.loop)
953+
{
954+
frame %= this._frames.length;
955+
}
956+
else
957+
{
958+
frame = this._frames.length - 1;
959+
}
960+
}
961+
962+
if (frame !== this._frameIndex)
963+
{
964+
this._frameIndex = frame;
965+
966+
this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);
967+
968+
if (this.currentFrame)
969+
{
970+
this._parent.setFrame(this.currentFrame);
971+
972+
if (this._parent.__tilePattern)
973+
{
974+
this._parent.__tilePattern = false;
975+
this._parent.tilingTexture = false;
976+
}
977+
}
978+
}
979+
980+
},
981+
982+
/**
983+
* Moves backwards the given number of frames in the Animation, taking the loop value into consideration.
984+
*
985+
* @method Phaser.Animation#previous
986+
* @param {number} [quantity=1] - The number of frames to move back.
987+
*/
988+
previous: function (quantity) {
989+
990+
if (typeof quantity === 'undefined') { quantity = 1; }
991+
992+
var frame = this._frameIndex - quantity;
993+
994+
if (frame &lt; 0)
995+
{
996+
if (this.loop)
997+
{
998+
frame = this._frames.length + frame;
999+
}
1000+
else
1001+
{
1002+
frame++;
1003+
}
1004+
}
1005+
1006+
if (frame !== this._frameIndex)
1007+
{
1008+
this._frameIndex = frame;
1009+
1010+
this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);
1011+
1012+
if (this.currentFrame)
1013+
{
1014+
this._parent.setFrame(this.currentFrame);
1015+
1016+
if (this._parent.__tilePattern)
1017+
{
1018+
this._parent.__tilePattern = false;
1019+
this._parent.tilingTexture = false;
1020+
}
1021+
}
1022+
}
1023+
1024+
},
1025+
9481026
/**
9491027
* Cleans up this animation ready for deletion. Nulls all values and references.
9501028
*
9511029
* @method Phaser.Animation#destroy
9521030
*/
9531031
destroy: function () {
1032+
9541033
this.game.onPause.remove(this.onPause, this);
9551034
this.game.onResume.remove(this.onResume, this);
9561035

@@ -1067,7 +1146,7 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
10671146
if (this.currentFrame !== null)
10681147
{
10691148
this._frameIndex = value;
1070-
this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]);
1149+
this._parent.setFrame(this.currentFrame);
10711150
}
10721151

10731152
}
@@ -1180,7 +1259,7 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
11801259

11811260
<span class="jsdoc-message">
11821261
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
1183-
on Tue May 20 2014 10:05:49 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
1262+
on Thu Jul 10 2014 20:18:55 GMT+0100 (BST) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
11841263
</span>
11851264
</footer>
11861265
</div>

0 commit comments

Comments
 (0)