Skip to content

Commit 26fe06e

Browse files
committed
Docs updates.
1 parent 37e4754 commit 26fe06e

File tree

231 files changed

+52795
-6638
lines changed

Some content is hidden

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

231 files changed

+52795
-6638
lines changed

docs/AABB.js.html

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,14 @@
154154
<a href="Phaser.Filter.html">Filter</a>
155155
</li>
156156

157+
<li class="class-depth-1">
158+
<a href="Phaser.FlexGrid.html">FlexGrid</a>
159+
</li>
160+
161+
<li class="class-depth-1">
162+
<a href="Phaser.FlexLayer.html">FlexLayer</a>
163+
</li>
164+
157165
<li class="class-depth-1">
158166
<a href="Phaser.Frame.html">Frame</a>
159167
</li>
@@ -342,6 +350,10 @@
342350
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
343351
</li>
344352

353+
<li class="class-depth-3">
354+
<a href="Phaser.Physics.P2.RotationalSpring.html">RotationalSpring</a>
355+
</li>
356+
345357
<li class="class-depth-3">
346358
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
347359
</li>
@@ -390,6 +402,10 @@
390402
<a href="Phaser.RetroFont.html">RetroFont</a>
391403
</li>
392404

405+
<li class="class-depth-1">
406+
<a href="Phaser.Rope.html">Rope</a>
407+
</li>
408+
393409
<li class="class-depth-1">
394410
<a href="Phaser.ScaleManager.html">ScaleManager</a>
395411
</li>
@@ -502,7 +518,7 @@
502518
</ul>
503519
</li>
504520

505-
</strong>
521+
506522
</ul>
507523
</div>
508524
</div>
@@ -1574,7 +1590,7 @@ <h1 class="page-title">Source: physics/ninja/AABB.js</h1>
15741590

15751591
<span class="jsdoc-message">
15761592
Documentation generated by <a href="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/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
1577-
on Fri Jul 18 2014 12:36:36 GMT+0100 (BST) using the <a href="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/terryweiss/docstrap">DocStrap template</a>.
1593+
on Tue Sep 09 2014 15:29:17 GMT+0100 (BST) using the <a href="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/terryweiss/docstrap">DocStrap template</a>.
15781594
</span>
15791595
</footer>
15801596
</div>

docs/Animation.js.html

Lines changed: 77 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,14 @@
154154
<a href="Phaser.Filter.html">Filter</a>
155155
</li>
156156

157+
<li class="class-depth-1">
158+
<a href="Phaser.FlexGrid.html">FlexGrid</a>
159+
</li>
160+
161+
<li class="class-depth-1">
162+
<a href="Phaser.FlexLayer.html">FlexLayer</a>
163+
</li>
164+
157165
<li class="class-depth-1">
158166
<a href="Phaser.Frame.html">Frame</a>
159167
</li>
@@ -342,6 +350,10 @@
342350
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
343351
</li>
344352

353+
<li class="class-depth-3">
354+
<a href="Phaser.Physics.P2.RotationalSpring.html">RotationalSpring</a>
355+
</li>
356+
345357
<li class="class-depth-3">
346358
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
347359
</li>
@@ -390,6 +402,10 @@
390402
<a href="Phaser.RetroFont.html">RetroFont</a>
391403
</li>
392404

405+
<li class="class-depth-1">
406+
<a href="Phaser.Rope.html">Rope</a>
407+
</li>
408+
393409
<li class="class-depth-1">
394410
<a href="Phaser.ScaleManager.html">ScaleManager</a>
395411
</li>
@@ -502,7 +518,7 @@
502518
</ul>
503519
</li>
504520

505-
</strong>
521+
506522
</ul>
507523
</div>
508524
</div>
@@ -648,6 +664,12 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
648664
*/
649665
this.onStart = new Phaser.Signal();
650666

667+
/**
668+
* @property {Phaser.Signal|null} onUpdate - This event is dispatched when the Animation changes frame. By default this event is disabled due to its intensive nature. Enable it with: `Animation.enableUpdate = true`.
669+
* @default
670+
*/
671+
this.onUpdate = null;
672+
651673
/**
652674
* @property {Phaser.Signal} onComplete - This event is dispatched when this Animation completes playback. If the animation is set to loop this is never fired, listen for onAnimationLoop instead.
653675
*/
@@ -926,6 +948,11 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
926948
this._parent.__tilePattern = false;
927949
this._parent.tilingTexture = false;
928950
}
951+
952+
if (this.onUpdate)
953+
{
954+
this.onUpdate.dispatch(this, this.currentFrame);
955+
}
929956
}
930957

931958
return true;
@@ -975,6 +1002,11 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
9751002
this._parent.tilingTexture = false;
9761003
}
9771004
}
1005+
1006+
if (this.onUpdate)
1007+
{
1008+
this.onUpdate.dispatch(this, this.currentFrame);
1009+
}
9781010
}
9791011

9801012
},
@@ -1019,6 +1051,11 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
10191051
this._parent.tilingTexture = false;
10201052
}
10211053
}
1054+
1055+
if (this.onUpdate)
1056+
{
1057+
this.onUpdate.dispatch(this, this.currentFrame);
1058+
}
10221059
}
10231060

10241061
},
@@ -1057,6 +1094,11 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
10571094
this.onLoop.dispose();
10581095
this.onComplete.dispose();
10591096

1097+
if (this.onUpdate)
1098+
{
1099+
this.onUpdate.dispose();
1100+
}
1101+
10601102
},
10611103

10621104
/**
@@ -1160,6 +1202,11 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
11601202
{
11611203
this._frameIndex = value;
11621204
this._parent.setFrame(this.currentFrame);
1205+
1206+
if (this.onUpdate)
1207+
{
1208+
this.onUpdate.dispatch(this, this.currentFrame);
1209+
}
11631210
}
11641211

11651212
}
@@ -1189,6 +1236,34 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
11891236

11901237
});
11911238

1239+
/**
1240+
* @name Phaser.Animation#enableUpdate
1241+
* @property {boolean} enableUpdate - Gets or sets if this animation will dispatch the onUpdate events upon changing frame.
1242+
*/
1243+
Object.defineProperty(Phaser.Animation.prototype, 'enableUpdate', {
1244+
1245+
get: function () {
1246+
1247+
return (this.onUpdate !== null);
1248+
1249+
},
1250+
1251+
set: function (value) {
1252+
1253+
if (value && this.onUpdate === null)
1254+
{
1255+
this.onUpdate = new Phaser.Signal();
1256+
}
1257+
else if (!value && this.onUpdate !== null)
1258+
{
1259+
this.onUpdate.dispose();
1260+
this.onUpdate = null;
1261+
}
1262+
1263+
}
1264+
1265+
});
1266+
11921267
/**
11931268
* Really handy function for when you are creating arrays of animation data but it's using frame names and not numbers.
11941269
* For example imagine you've got 30 frames named: 'explosion_0001-large' to 'explosion_0030-large'
@@ -1272,7 +1347,7 @@ <h1 class="page-title">Source: animation/Animation.js</h1>
12721347

12731348
<span class="jsdoc-message">
12741349
Documentation generated by <a href="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/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
1275-
on Fri Jul 18 2014 12:36:36 GMT+0100 (BST) using the <a href="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/terryweiss/docstrap">DocStrap template</a>.
1350+
on Tue Sep 09 2014 15:29:17 GMT+0100 (BST) using the <a href="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/terryweiss/docstrap">DocStrap template</a>.
12761351
</span>
12771352
</footer>
12781353
</div>

docs/AnimationManager.js.html

Lines changed: 60 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,14 @@
154154
<a href="Phaser.Filter.html">Filter</a>
155155
</li>
156156

157+
<li class="class-depth-1">
158+
<a href="Phaser.FlexGrid.html">FlexGrid</a>
159+
</li>
160+
161+
<li class="class-depth-1">
162+
<a href="Phaser.FlexLayer.html">FlexLayer</a>
163+
</li>
164+
157165
<li class="class-depth-1">
158166
<a href="Phaser.Frame.html">Frame</a>
159167
</li>
@@ -342,6 +350,10 @@
342350
<a href="Phaser.Physics.P2.RevoluteConstraint.html">RevoluteConstraint</a>
343351
</li>
344352

353+
<li class="class-depth-3">
354+
<a href="Phaser.Physics.P2.RotationalSpring.html">RotationalSpring</a>
355+
</li>
356+
345357
<li class="class-depth-3">
346358
<a href="Phaser.Physics.P2.Spring.html">Spring</a>
347359
</li>
@@ -390,6 +402,10 @@
390402
<a href="Phaser.RetroFont.html">RetroFont</a>
391403
</li>
392404

405+
<li class="class-depth-1">
406+
<a href="Phaser.Rope.html">Rope</a>
407+
</li>
408+
393409
<li class="class-depth-1">
394410
<a href="Phaser.ScaleManager.html">ScaleManager</a>
395411
</li>
@@ -502,7 +518,7 @@
502518
</ul>
503519
</li>
504520

505-
</strong>
521+
506522
</ul>
507523
</div>
508524
</div>
@@ -634,15 +650,51 @@ <h1 class="page-title">Source: animation/AnimationManager.js</h1>
634650

635651
this.isLoaded = true;
636652

637-
if (this._frameData)
653+
return true;
654+
},
655+
656+
/**
657+
* Loads FrameData into the internal temporary vars and resets the frame index to zero.
658+
* This is called automatically when a new Sprite is created.
659+
*
660+
* @method Phaser.AnimationManager#copyFrameData
661+
* @private
662+
* @param {Phaser.FrameData} frameData - The FrameData set to load.
663+
* @param {string|number} frame - The frame to default to.
664+
* @return {boolean} Returns `true` if the frame data was loaded successfully, otherwise `false`
665+
*/
666+
copyFrameData: function (frameData, frame) {
667+
668+
this._frameData = frameData.clone();
669+
670+
if (this.isLoaded)
638671
{
639-
return true;
672+
// We need to update the frameData that the animations are using
673+
for (var anim in this._anims)
674+
{
675+
this._anims[anim].updateFrameData(this._frameData);
676+
}
677+
}
678+
679+
if (typeof frame === 'undefined' || frame === null)
680+
{
681+
this.frame = 0;
640682
}
641683
else
642684
{
643-
return false;
685+
if (typeof frame === 'string')
686+
{
687+
this.frameName = frame;
688+
}
689+
else
690+
{
691+
this.frame = frame;
692+
}
644693
}
645694

695+
this.isLoaded = true;
696+
697+
return true;
646698
},
647699

648700
/**
@@ -659,12 +711,6 @@ <h1 class="page-title">Source: animation/AnimationManager.js</h1>
659711
*/
660712
add: function (name, frames, frameRate, loop, useNumericIndex) {
661713

662-
if (this._frameData === null)
663-
{
664-
console.warn('No FrameData available for Phaser.Animation ' + name);
665-
return;
666-
}
667-
668714
frames = frames || [];
669715
frameRate = frameRate || 60;
670716

@@ -964,14 +1010,7 @@ <h1 class="page-title">Source: animation/AnimationManager.js</h1>
9641010

9651011
get: function () {
9661012

967-
if (this._frameData)
968-
{
969-
return this._frameData.total;
970-
}
971-
else
972-
{
973-
return -1;
974-
}
1013+
return this._frameData.total;
9751014
}
9761015

9771016
});
@@ -1013,7 +1052,7 @@ <h1 class="page-title">Source: animation/AnimationManager.js</h1>
10131052

10141053
set: function (value) {
10151054

1016-
if (typeof value === 'number' && this._frameData && this._frameData.getFrame(value) !== null)
1055+
if (typeof value === 'number' && this._frameData.getFrame(value) !== null)
10171056
{
10181057
this.currentFrame = this._frameData.getFrame(value);
10191058

@@ -1052,7 +1091,7 @@ <h1 class="page-title">Source: animation/AnimationManager.js</h1>
10521091

10531092
set: function (value) {
10541093

1055-
if (typeof value === 'string' && this._frameData && this._frameData.getFrameByName(value) !== null)
1094+
if (typeof value === 'string' && this._frameData.getFrameByName(value) !== null)
10561095
{
10571096
this.currentFrame = this._frameData.getFrameByName(value);
10581097

@@ -1097,7 +1136,7 @@ <h1 class="page-title">Source: animation/AnimationManager.js</h1>
10971136

10981137
<span class="jsdoc-message">
10991138
Documentation generated by <a href="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/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
1100-
on Fri Jul 18 2014 12:36:36 GMT+0100 (BST) using the <a href="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/terryweiss/docstrap">DocStrap template</a>.
1139+
on Tue Sep 09 2014 15:29:17 GMT+0100 (BST) using the <a href="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/terryweiss/docstrap">DocStrap template</a>.
11011140
</span>
11021141
</footer>
11031142
</div>

0 commit comments

Comments
 (0)