Skip to content

Commit 47123c1

Browse files
committed
2.4.6 Build files + docs + TS Docs.
1 parent 8669947 commit 47123c1

400 files changed

Lines changed: 1729 additions & 1025 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.

‎README.md‎

Lines changed: 102 additions & 5 deletions
Large diffs are not rendered by default.

‎build/custom/p2.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎build/custom/phaser-arcade-physics.js‎

Lines changed: 49 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Phaser - http://phaser.io
99
*
10-
* v2.4.5 "Sienda" - Built: Wed Feb 17 2016 13:36:39
10+
* v2.4.6 "Baerlon" - Built: Thu Feb 18 2016 14:40:00
1111
*
1212
* By Richard Davey http://www.photonstorm.com @photonstorm
1313
*
@@ -6951,7 +6951,10 @@ PIXI.BaseTexture.prototype.destroy = function()
69516951
{
69526952
PIXI.CanvasPool.removeByCanvas(this.source);
69536953

6954-
delete PIXI.BaseTextureCache[this.source];
6954+
if (this.source._pixiId)
6955+
{
6956+
delete PIXI.BaseTextureCache[this.source._pixiId];
6957+
}
69556958
}
69566959

69576960
this.source = null;
@@ -9118,7 +9121,7 @@ var Phaser = Phaser || {
91189121
* @constant
91199122
* @type {string}
91209123
*/
9121-
VERSION: '2.4.5',
9124+
VERSION: '2.4.6',
91229125

91239126
/**
91249127
* An array of Phaser game instances.
@@ -15440,7 +15443,7 @@ Phaser.StateManager.prototype = {
1544015443
{
1544115444
this.game.world.shutdown();
1544215445

15443-
if (this._clearCache === true)
15446+
if (this._clearCache)
1544415447
{
1544515448
this.game.cache.destroy();
1544615449
}
@@ -15769,6 +15772,9 @@ Phaser.StateManager.prototype = {
1576915772
*/
1577015773
destroy: function () {
1577115774

15775+
this._clearWorld = true;
15776+
this._clearCache = true;
15777+
1577215778
this.clearCurrentState();
1577315779

1577415780
this.callbackContext = null;
@@ -17850,7 +17856,7 @@ Phaser.Group.prototype.add = function (child, silent) {
1785017856

1785117857
if (child.parent !== this)
1785217858
{
17853-
if (child.body)
17859+
if (child.body && child.parent)
1785417860
{
1785517861
child.parent.removeFromHash(child);
1785617862
}
@@ -17981,7 +17987,7 @@ Phaser.Group.prototype.addAt = function (child, index, silent) {
1798117987

1798217988
if (child.parent !== this)
1798317989
{
17984-
if (child.body)
17990+
if (child.body && child.parent)
1798517991
{
1798617992
child.parent.removeFromHash(child);
1798717993
}
@@ -34119,9 +34125,13 @@ Phaser.SpriteBatch.prototype.constructor = Phaser.SpriteBatch;
3411934125

3412034126
/**
3412134127
* A BitmapData object contains a Canvas element to which you can draw anything you like via normal Canvas context operations.
34122-
* A single BitmapData can be used as the texture for one or many Images/Sprites.
34128+
* A single BitmapData can be used as the texture for one or many Images / Sprites.
3412334129
* So if you need to dynamically create a Sprite texture then they are a good choice.
3412434130
*
34131+
* Important note: Every BitmapData creates its own Canvas element. Because BitmapData's are now Game Objects themselves, and don't
34132+
* live on the display list, they are NOT automatically cleared when you change State. Therefore you _must_ call BitmapData.destroy
34133+
* in your State's shutdown method if you wish to free-up the resources the BitmapData used, it will not happen for you.
34134+
*
3412534135
* @class Phaser.BitmapData
3412634136
* @constructor
3412734137
* @param {Phaser.Game} game - A reference to the currently running game.
@@ -35966,6 +35976,8 @@ Phaser.BitmapData.prototype = {
3596635976
*/
3596735977
destroy: function () {
3596835978

35979+
this.texture.destroy(true);
35980+
3596935981
PIXI.CanvasPool.remove(this);
3597035982

3597135983
},
@@ -47169,6 +47181,18 @@ Phaser.RandomDataGenerator.prototype = {
4716947181

4717047182
},
4717147183

47184+
/**
47185+
* Returns a sign to be used with multiplication operator.
47186+
*
47187+
* @method Phaser.RandomDataGenerator#sign
47188+
* @return {number} -1 or +1.
47189+
*/
47190+
sign: function () {
47191+
47192+
return this.pick([-1, 1]);
47193+
47194+
},
47195+
4717247196
/**
4717347197
* Returns a random member of `array`, favoring the earlier entries.
4717447198
*
@@ -58389,6 +58413,11 @@ Phaser.Loader.prototype = {
5838958413
{
5839058414
videoType = url.type;
5839158415
url = url.uri;
58416+
58417+
if (this.game.device.canPlayVideo(videoType))
58418+
{
58419+
return url;
58420+
}
5839258421
}
5839358422
else
5839458423
{
@@ -58406,11 +58435,11 @@ Phaser.Loader.prototype = {
5840658435
var extension = url.substr((Math.max(0, url.lastIndexOf(".")) || Infinity) + 1);
5840758436

5840858437
videoType = extension.toLowerCase();
58409-
}
5841058438

58411-
if (this.game.device.canPlayVideo(videoType))
58412-
{
58413-
return url;
58439+
if (this.game.device.canPlayVideo(videoType))
58440+
{
58441+
return urls[i];
58442+
}
5841458443
}
5841558444
}
5841658445

@@ -58444,6 +58473,11 @@ Phaser.Loader.prototype = {
5844458473
{
5844558474
audioType = url.type;
5844658475
url = url.uri;
58476+
58477+
if (this.game.device.canPlayAudio(audioType))
58478+
{
58479+
return url;
58480+
}
5844758481
}
5844858482
else
5844958483
{
@@ -58461,11 +58495,11 @@ Phaser.Loader.prototype = {
5846158495
var extension = url.substr((Math.max(0, url.lastIndexOf(".")) || Infinity) + 1);
5846258496

5846358497
audioType = extension.toLowerCase();
58464-
}
5846558498

58466-
if (this.game.device.canPlayAudio(audioType))
58467-
{
58468-
return url;
58499+
if (this.game.device.canPlayAudio(audioType))
58500+
{
58501+
return urls[i];
58502+
}
5846958503
}
5847058504
}
5847158505

‎build/custom/phaser-arcade-physics.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎build/custom/phaser-arcade-physics.min.js‎

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎build/custom/phaser-minimum.js‎

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Phaser - http://phaser.io
99
*
10-
* v2.4.5 "Sienda" - Built: Wed Feb 17 2016 13:36:56
10+
* v2.4.6 "Baerlon" - Built: Thu Feb 18 2016 14:40:18
1111
*
1212
* By Richard Davey http://www.photonstorm.com @photonstorm
1313
*
@@ -6951,7 +6951,10 @@ PIXI.BaseTexture.prototype.destroy = function()
69516951
{
69526952
PIXI.CanvasPool.removeByCanvas(this.source);
69536953

6954-
delete PIXI.BaseTextureCache[this.source];
6954+
if (this.source._pixiId)
6955+
{
6956+
delete PIXI.BaseTextureCache[this.source._pixiId];
6957+
}
69556958
}
69566959

69576960
this.source = null;
@@ -7921,7 +7924,7 @@ var Phaser = Phaser || {
79217924
* @constant
79227925
* @type {string}
79237926
*/
7924-
VERSION: '2.4.5',
7927+
VERSION: '2.4.6',
79257928

79267929
/**
79277930
* An array of Phaser game instances.
@@ -14243,7 +14246,7 @@ Phaser.StateManager.prototype = {
1424314246
{
1424414247
this.game.world.shutdown();
1424514248

14246-
if (this._clearCache === true)
14249+
if (this._clearCache)
1424714250
{
1424814251
this.game.cache.destroy();
1424914252
}
@@ -14572,6 +14575,9 @@ Phaser.StateManager.prototype = {
1457214575
*/
1457314576
destroy: function () {
1457414577

14578+
this._clearWorld = true;
14579+
this._clearCache = true;
14580+
1457514581
this.clearCurrentState();
1457614582

1457714583
this.callbackContext = null;
@@ -16653,7 +16659,7 @@ Phaser.Group.prototype.add = function (child, silent) {
1665316659

1665416660
if (child.parent !== this)
1665516661
{
16656-
if (child.body)
16662+
if (child.body && child.parent)
1665716663
{
1665816664
child.parent.removeFromHash(child);
1665916665
}
@@ -16784,7 +16790,7 @@ Phaser.Group.prototype.addAt = function (child, index, silent) {
1678416790

1678516791
if (child.parent !== this)
1678616792
{
16787-
if (child.body)
16793+
if (child.body && child.parent)
1678816794
{
1678916795
child.parent.removeFromHash(child);
1679016796
}
@@ -33690,6 +33696,18 @@ Phaser.RandomDataGenerator.prototype = {
3369033696

3369133697
},
3369233698

33699+
/**
33700+
* Returns a sign to be used with multiplication operator.
33701+
*
33702+
* @method Phaser.RandomDataGenerator#sign
33703+
* @return {number} -1 or +1.
33704+
*/
33705+
sign: function () {
33706+
33707+
return this.pick([-1, 1]);
33708+
33709+
},
33710+
3369333711
/**
3369433712
* Returns a random member of `array`, favoring the earlier entries.
3369533713
*
@@ -42353,6 +42371,11 @@ Phaser.Loader.prototype = {
4235342371
{
4235442372
videoType = url.type;
4235542373
url = url.uri;
42374+
42375+
if (this.game.device.canPlayVideo(videoType))
42376+
{
42377+
return url;
42378+
}
4235642379
}
4235742380
else
4235842381
{
@@ -42370,11 +42393,11 @@ Phaser.Loader.prototype = {
4237042393
var extension = url.substr((Math.max(0, url.lastIndexOf(".")) || Infinity) + 1);
4237142394

4237242395
videoType = extension.toLowerCase();
42373-
}
4237442396

42375-
if (this.game.device.canPlayVideo(videoType))
42376-
{
42377-
return url;
42397+
if (this.game.device.canPlayVideo(videoType))
42398+
{
42399+
return urls[i];
42400+
}
4237842401
}
4237942402
}
4238042403

@@ -42408,6 +42431,11 @@ Phaser.Loader.prototype = {
4240842431
{
4240942432
audioType = url.type;
4241042433
url = url.uri;
42434+
42435+
if (this.game.device.canPlayAudio(audioType))
42436+
{
42437+
return url;
42438+
}
4241142439
}
4241242440
else
4241342441
{
@@ -42425,11 +42453,11 @@ Phaser.Loader.prototype = {
4242542453
var extension = url.substr((Math.max(0, url.lastIndexOf(".")) || Infinity) + 1);
4242642454

4242742455
audioType = extension.toLowerCase();
42428-
}
4242942456

42430-
if (this.game.device.canPlayAudio(audioType))
42431-
{
42432-
return url;
42457+
if (this.game.device.canPlayAudio(audioType))
42458+
{
42459+
return urls[i];
42460+
}
4243342461
}
4243442462
}
4243542463

‎build/custom/phaser-minimum.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎build/custom/phaser-minimum.min.js‎

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)