Skip to content

Commit 8afdc74

Browse files
committed
Build Phaser v2.8.0
1 parent b1c490d commit 8afdc74

File tree

421 files changed

+10980
-2907
lines changed

Some content is hidden

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

421 files changed

+10980
-2907
lines changed

build/custom/creature.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/p2.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/phaser-arcade-physics.js

+340-124
Large diffs are not rendered by default.

build/custom/phaser-arcade-physics.map

+1-1
Large diffs are not rendered by default.

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

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/phaser-creature.js

+340-124
Large diffs are not rendered by default.

build/custom/phaser-creature.map

+1-1
Large diffs are not rendered by default.

build/custom/phaser-creature.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/phaser-minimum.js

+160-21
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Phaser - http://phaser.io
99
*
10-
* v2.7.10 "2017-05-19" - Built: Fri May 19 2017 15:17:19
10+
* v2.8.0 "2017-05-30" - Built: Tue May 30 2017 21:46:19
1111
*
1212
* By Richard Davey http://www.photonstorm.com @photonstorm
1313
*
@@ -7566,7 +7566,7 @@ var Phaser = Phaser || { // jshint ignore:line
75667566
* @constant Phaser.VERSION
75677567
* @type {string}
75687568
*/
7569-
VERSION: '2.7.10',
7569+
VERSION: '2.8.0',
75707570

75717571
/**
75727572
* An array of Phaser game instances.
@@ -10775,7 +10775,7 @@ PIXI.identityMatrix = Phaser.identityMatrix;
1077510775
* The following code creates a point at (0,0):
1077610776
* `var myPoint = new Phaser.Point();`
1077710777
* You can also use them as 2D Vectors and you'll find different vector related methods in this class.
10778-
*
10778+
*
1077910779
* @class Phaser.Point
1078010780
* @constructor
1078110781
* @param {number} [x=0] - The horizontal position of this Point.
@@ -11172,7 +11172,7 @@ Phaser.Point.prototype = {
1117211172

1117311173
/**
1117411174
* The dot product of this and another Point object.
11175-
*
11175+
*
1117611176
* @method Phaser.Point#dot
1117711177
* @param {Phaser.Point} a - The Point object to get the dot product combined with this Point.
1117811178
* @return {number} The result.
@@ -11185,7 +11185,7 @@ Phaser.Point.prototype = {
1118511185

1118611186
/**
1118711187
* The cross product of this and another Point object.
11188-
*
11188+
*
1118911189
* @method Phaser.Point#cross
1119011190
* @param {Phaser.Point} a - The Point object to get the cross product combined with this Point.
1119111191
* @return {number} The result.
@@ -11198,7 +11198,7 @@ Phaser.Point.prototype = {
1119811198

1119911199
/**
1120011200
* Make this Point perpendicular (90 degrees rotation)
11201-
*
11201+
*
1120211202
* @method Phaser.Point#perp
1120311203
* @return {Phaser.Point} This Point object.
1120411204
*/
@@ -11210,7 +11210,7 @@ Phaser.Point.prototype = {
1121011210

1121111211
/**
1121211212
* Make this Point perpendicular (-90 degrees rotation)
11213-
*
11213+
*
1121411214
* @method Phaser.Point#rperp
1121511215
* @return {Phaser.Point} This Point object.
1121611216
*/
@@ -11399,7 +11399,7 @@ Phaser.Point.negative = function (a, out) {
1139911399

1140011400
/**
1140111401
* Adds two 2D Points together and multiplies the result by the given scalar.
11402-
*
11402+
*
1140311403
* @method Phaser.Point.multiplyAdd
1140411404
* @param {Phaser.Point} a - The first Point object.
1140511405
* @param {Phaser.Point} b - The second Point object.
@@ -11417,7 +11417,7 @@ Phaser.Point.multiplyAdd = function (a, b, s, out) {
1141711417

1141811418
/**
1141911419
* Interpolates the two given Points, based on the `f` value (between 0 and 1) and returns a new Point.
11420-
*
11420+
*
1142111421
* @method Phaser.Point.interpolate
1142211422
* @param {Phaser.Point} a - The first Point object.
1142311423
* @param {Phaser.Point} b - The second Point object.
@@ -11483,7 +11483,7 @@ Phaser.Point.distance = function (a, b, round) {
1148311483

1148411484
/**
1148511485
* Project two Points onto another Point.
11486-
*
11486+
*
1148711487
* @method Phaser.Point.project
1148811488
* @param {Phaser.Point} a - The first Point object.
1148911489
* @param {Phaser.Point} b - The second Point object.
@@ -11507,7 +11507,7 @@ Phaser.Point.project = function (a, b, out) {
1150711507

1150811508
/**
1150911509
* Project two Points onto a Point of unit length.
11510-
*
11510+
*
1151111511
* @method Phaser.Point.projectUnit
1151211512
* @param {Phaser.Point} a - The first Point object.
1151311513
* @param {Phaser.Point} b - The second Point object.
@@ -11573,7 +11573,7 @@ Phaser.Point.normalize = function (a, out) {
1157311573
* the angle specified. If the angle between the point and coordinates was 45 deg and the angle argument
1157411574
* is 45 deg then the resulting angle will be 90 deg, as the angle argument is added to the current angle.
1157511575
*
11576-
* The distance allows you to specify a distance constraint for the rotation between the point and the
11576+
* The distance allows you to specify a distance constraint for the rotation between the point and the
1157711577
* coordinates. If none is given the distance between the two is calculated and used.
1157811578
*
1157911579
* @method Phaser.Point.rotate
@@ -11686,6 +11686,19 @@ Phaser.Point.parse = function(obj, xProp, yProp) {
1168611686

1168711687
};
1168811688

11689+
/**
11690+
* Tests a Point or Point-like object.
11691+
*
11692+
* @method Phaser.Point.isPoint
11693+
* @static
11694+
* @return {boolean} - True if the object has numeric x and y properties.
11695+
*/
11696+
Phaser.Point.isPoint = function(obj) {
11697+
11698+
return (obj != null) && (typeof obj.x === 'number') && (typeof obj.y === 'number');
11699+
11700+
};
11701+
1168911702
// Because PIXI uses its own Point, we'll replace it with ours to avoid duplicating code or confusion.
1169011703
PIXI.Point = Phaser.Point;
1169111704

@@ -18367,7 +18380,7 @@ Phaser.Group.prototype.setAllChildren = function (key, value, checkAlive, checkV
1836718380
};
1836818381

1836918382
/**
18370-
* Check that the same property across all children of this group is equal to the given value.
18383+
* Test that the same property across all children of this group is equal to the given value.
1837118384
*
1837218385
* This call doesn't descend down children, so if you have a Group inside of this group, the property will be checked on the group but not its children.
1837318386
*
@@ -18401,6 +18414,39 @@ Phaser.Group.prototype.checkAll = function (key, value, checkAlive, checkVisible
1840118414

1840218415
};
1840318416

18417+
/**
18418+
* Test that at least one child of this group has the given property value.
18419+
*
18420+
* This call doesn't descend down children, so if you have a Group inside of this group, the property will be checked on the group but not its children.
18421+
*
18422+
* @method Phaser.Group#checkAny
18423+
* @param {string} key - The property, as a string, to be checked. For example: 'body.velocity.x'
18424+
* @param {any} value - The value that will be checked.
18425+
* @param {boolean} [checkAlive=false] - If set then only children with alive=true will be checked. This includes any Groups that are children.
18426+
* @param {boolean} [checkVisible=false] - If set then only children with visible=true will be checked. This includes any Groups that are children.
18427+
*/
18428+
Phaser.Group.prototype.checkAny = function (key, value, checkAlive, checkVisible) {
18429+
18430+
if (checkAlive === undefined) { checkAlive = false; }
18431+
if (checkVisible === undefined) { checkVisible = false; }
18432+
18433+
for (var i = 0; i < this.children.length; i++)
18434+
{
18435+
var child = this.children[i];
18436+
18437+
if ((!checkAlive || (checkAlive && child.alive)) && (!checkVisible || (checkVisible && child.visible)))
18438+
{
18439+
if (this.checkProperty(child, key, value))
18440+
{
18441+
return true;
18442+
}
18443+
}
18444+
}
18445+
18446+
return false;
18447+
18448+
};
18449+
1840418450
/**
1840518451
* Adds the amount to the given property on all children in this group.
1840618452
*
@@ -18469,6 +18515,44 @@ Phaser.Group.prototype.divideAll = function (property, amount, checkAlive, check
1846918515

1847018516
};
1847118517

18518+
/**
18519+
* Kills all children having exists=true.
18520+
*
18521+
* @method Phaser.Group#killAll
18522+
*/
18523+
Phaser.Group.prototype.killAll = function () {
18524+
18525+
this.callAllExists('kill', true);
18526+
18527+
};
18528+
18529+
/**
18530+
* Revives all children having exists=false.
18531+
*
18532+
* @method Phaser.Group#reviveAll
18533+
*/
18534+
Phaser.Group.prototype.reviveAll = function () {
18535+
18536+
this.callAllExists('revive', false);
18537+
18538+
};
18539+
18540+
/**
18541+
* Calls {@link #resetChild} on each child (or each existing child).
18542+
*
18543+
* @method Phaser.Group#resetAll
18544+
* @param {number} [x] - The x coordinate to reset each child to. The value is in relation to the group.x point.
18545+
* @param {number} [y] - The y coordinate to reset each child to. The value is in relation to the group.y point.
18546+
* @param {string|Phaser.RenderTexture|Phaser.BitmapData|Phaser.Video|PIXI.Texture} [key] - The image or texture used by the Sprite during rendering.
18547+
* @param {string|number} [frame] - The frame of a sprite sheet or texture atlas.
18548+
* @param {boolean} [checkExists=false] - Reset only existing children.
18549+
*/
18550+
Phaser.Group.prototype.resetAll = function (x, y, key, frame, checkExists) {
18551+
18552+
this.forEach(this.resetChild, this, checkExists, x, y, key, frame);
18553+
18554+
};
18555+
1847218556
/**
1847318557
* Calls a function, specified by name, on all children in the group who exist (or do not exist).
1847418558
*
@@ -19654,6 +19738,25 @@ Phaser.Group.prototype.removeBetween = function (startIndex, endIndex, destroy,
1965419738

1965519739
};
1965619740

19741+
/**
19742+
* Places each child at a random position within the given Rectangle (or the {@link Phaser.World#bounds World bounds}).
19743+
*
19744+
* @method Phaser.Group.prototype#scatter
19745+
* @param {Phaser.Rectangle} [rect=this.game.world.bounds] - A Rectangle. If omitted {@link Phaser.World#bounds} is used.
19746+
* @param {boolean} [checkExists=false] - Place only children with exists=true.
19747+
*/
19748+
Phaser.Group.prototype.scatter = function (rect, checkExists) {
19749+
19750+
if (rect == null) { rect = this.game.world.bounds; }
19751+
19752+
this.forEach(function (child) {
19753+
19754+
child.position.set(rect.randomX, rect.randomY);
19755+
19756+
}, null, checkExists);
19757+
19758+
};
19759+
1965719760
/**
1965819761
* Destroys this group.
1965919762
*
@@ -38392,6 +38495,7 @@ Phaser.Timer.prototype = {
3839238495

3839338496
this.onComplete.removeAll();
3839438497
this.running = false;
38498+
this.expired = true;
3839538499
this.events = [];
3839638500
this._len = 0;
3839738501
this._i = 0;
@@ -50555,8 +50659,8 @@ Phaser.LinkedList.prototype.constructor = Phaser.LinkedList;
5055550659
* quickly and easily, without the need for any external files. You can create textures for sprites and in
5055650660
* coming releases we'll add dynamic sound effect generation support as well (like sfxr).
5055750661
*
50558-
* Access this via `Game.create` (`this.game.create` from within a State object)
50559-
*
50662+
* Access this via `Game.create` (`this.game.create` from within a State object).
50663+
*
5056050664
* @class Phaser.Create
5056150665
* @constructor
5056250666
* @param {Phaser.Game} game - Game reference to the currently running game.
@@ -50662,13 +50766,17 @@ Phaser.Create.prototype = {
5066250766
* @param {integer} [pixelWidth=8] - The width of each pixel.
5066350767
* @param {integer} [pixelHeight=8] - The height of each pixel.
5066450768
* @param {integer} [palette=0] - The palette to use when rendering the texture. One of the Phaser.Create.PALETTE consts.
50665-
* @return {PIXI.Texture} The newly generated texture.
50769+
* @param {boolean} [generateTexture=true] - When false, a new BitmapData object is returned instead.
50770+
* @param {function} [callback] - A function to execute once the texture is generated. It will be passed the newly generated texture.
50771+
* @param {any} [callbackContext] - The context in which to invoke the callback.
50772+
* @return {?PIXI.Texture|Phaser.BitmapData} The newly generated texture, or a new BitmapData object if `generateTexture` is false, or `null` if a callback was passed and the texture isn't available yet.
5066650773
*/
50667-
texture: function (key, data, pixelWidth, pixelHeight, palette) {
50774+
texture: function (key, data, pixelWidth, pixelHeight, palette, generateTexture, callback, callbackContext) {
5066850775

5066950776
if (pixelWidth === undefined) { pixelWidth = 8; }
5067050777
if (pixelHeight === undefined) { pixelHeight = pixelWidth; }
5067150778
if (palette === undefined) { palette = 0; }
50779+
if (generateTexture === undefined) { generateTexture = true; }
5067250780

5067350781
var w = data[0].length * pixelWidth;
5067450782
var h = data.length * pixelHeight;
@@ -50701,7 +50809,9 @@ Phaser.Create.prototype = {
5070150809
}
5070250810
}
5070350811

50704-
return this.bmd.generateTexture(key);
50812+
return generateTexture ?
50813+
this.bmd.generateTexture(key, callback, callbackContext) :
50814+
this.copy();
5070550815

5070650816
},
5070750817

@@ -50715,9 +50825,14 @@ Phaser.Create.prototype = {
5071550825
* @param {integer} cellWidth - The width of the grid cells in pixels.
5071650826
* @param {integer} cellHeight - The height of the grid cells in pixels.
5071750827
* @param {string} color - The color to draw the grid lines in. Should be a Canvas supported color string like `#ff5500` or `rgba(200,50,3,0.5)`.
50718-
* @return {PIXI.Texture} The newly generated texture.
50828+
* @param {boolean} [generateTexture=true] - When false, a new BitmapData object is returned instead.
50829+
* @param {function} [callback] - A function to execute once the texture is generated. It will be passed the newly generated texture.
50830+
* @param {any} [callbackContext] - The context in which to invoke the callback.
50831+
* @return {?PIXI.Texture|Phaser.BitmapData} The newly generated texture, or a new BitmapData object if `generateTexture` is false, or `null` if a callback was passed and the texture isn't available yet.
5071950832
*/
50720-
grid: function (key, width, height, cellWidth, cellHeight, color) {
50833+
grid: function (key, width, height, cellWidth, cellHeight, color, generateTexture, callback, callbackContext) {
50834+
50835+
if (generateTexture === undefined) { generateTexture = true; }
5072150836

5072250837
// No bmd? Let's make one
5072350838
if (this.bmd === null)
@@ -50741,7 +50856,31 @@ Phaser.Create.prototype = {
5074150856
this.ctx.fillRect(x, 0, 1, height);
5074250857
}
5074350858

50744-
return this.bmd.generateTexture(key);
50859+
return generateTexture ?
50860+
this.bmd.generateTexture(key, callback, callbackContext) :
50861+
this.copy();
50862+
50863+
},
50864+
50865+
/**
50866+
* Copies the contents of {@link bmd Create's canvas} to the given BitmapData object, or a new BitmapData object.
50867+
*
50868+
* @param {Phaser.BitmapData} [dest] - The BitmapData receiving the copied image.
50869+
* @param {number} [x=0] - The x coordinate to translate to before drawing.
50870+
* @param {number} [y=0] - The y coordinate to translate to before drawing.
50871+
* @param {number} [width] - The new width of the Sprite being copied.
50872+
* @param {number} [height] - The new height of the Sprite being copied.
50873+
* @param {string} [blendMode=null] - The composite blend mode that will be used when drawing. The default is no blend mode at all. This is a Canvas globalCompositeOperation value such as 'lighter' or 'xor'.
50874+
* @param {boolean} [roundPx=false] - Should the x and y values be rounded to integers before drawing? This prevents anti-aliasing in some instances.
50875+
* @return {Phaser.BitmapData} - The `dest` argument (if passed), or a new BitmapData object
50876+
*/
50877+
copy: function (dest, x, y, width, height, blendMode, roundPx) {
50878+
50879+
if (dest == null) { dest = this.game.make.bitmapData(); }
50880+
50881+
dest.resize(this.bmd.width, this.bmd.height);
50882+
50883+
return dest.draw(this.bmd, x, y, width, height, blendMode, roundPx);
5074550884

5074650885
}
5074750886

build/custom/phaser-minimum.map

+1-1
Large diffs are not rendered by default.

build/custom/phaser-minimum.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)