Skip to content

Commit e86f495

Browse files
committed
Build Phaser v2.10.1
1 parent 16550df commit e86f495

File tree

218 files changed

+9075
-8124
lines changed

Some content is hidden

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

218 files changed

+9075
-8124
lines changed

build/custom/README.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

build/custom/creature.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/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: 145 additions & 55 deletions
Large diffs are not rendered by default.

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: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/phaser-creature.js

Lines changed: 145 additions & 55 deletions
Large diffs are not rendered by default.

build/custom/phaser-creature.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-creature.min.js

Lines changed: 2 additions & 2 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: 85 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Phaser - http://phaser.io
99
*
10-
* v2.10.0 "2018-01-18" - Built: Thu Jan 18 2018 16:35:27
10+
* v2.10.1 "2018-02-18" - Built: Sun Feb 18 2018 16:36:18
1111
*
1212
* By Richard Davey http://www.photonstorm.com @photonstorm
1313
*
@@ -7583,7 +7583,7 @@ var Phaser = Phaser || { // jshint ignore:line
75837583
* @constant Phaser.VERSION
75847584
* @type {string}
75857585
*/
7586-
VERSION: '2.10.0',
7586+
VERSION: '2.10.1',
75877587

75887588
/**
75897589
* An array of Phaser game instances.
@@ -9021,7 +9021,7 @@ Phaser.Circle.prototype = {
90219021
/**
90229022
* Returns a new Circle object with the same values for the x, y, width, and height properties as this Circle object.
90239023
* @method Phaser.Circle#clone
9024-
* @param {Phaser.Circle} output - Optional Circle object. If given the values will be set into the object, otherwise a brand new Circle object will be created and returned.
9024+
* @param {Phaser.Circle} [output] - Optional Circle object. If given the values will be set into the object, otherwise a brand new Circle object will be created and returned.
90259025
* @return {Phaser.Circle} The cloned Circle object.
90269026
*/
90279027
clone: function (output) {
@@ -9630,7 +9630,7 @@ Phaser.Ellipse.prototype = {
96309630
/**
96319631
* Returns a new Ellipse object with the same values for the x, y, width, and height properties as this Ellipse object.
96329632
* @method Phaser.Ellipse#clone
9633-
* @param {Phaser.Ellipse} output - Optional Ellipse object. If given the values will be set into the object, otherwise a brand new Ellipse object will be created and returned.
9633+
* @param {Phaser.Ellipse} [output] - Optional Ellipse object. If given the values will be set into the object, otherwise a brand new Ellipse object will be created and returned.
96349634
* @return {Phaser.Ellipse} The cloned Ellipse object.
96359635
*/
96369636
clone: function(output) {
@@ -10239,7 +10239,7 @@ Phaser.Line.prototype = {
1023910239
/**
1024010240
* Returns a new Line object with the same values for the start and end properties as this Line object.
1024110241
* @method Phaser.Line#clone
10242-
* @param {Phaser.Line} output - Optional Line object. If given the values will be set into the object, otherwise a brand new Line object will be created and returned.
10242+
* @param {Phaser.Line} [output] - Optional Line object. If given the values will be set into the object, otherwise a brand new Line object will be created and returned.
1024310243
* @return {Phaser.Line} The cloned Line object.
1024410244
*/
1024510245
clone: function (output) {
@@ -12384,7 +12384,7 @@ Phaser.Polygon.prototype = {
1238412384
* This is a deep clone, the resulting copy contains new Phaser.Point objects
1238512385
*
1238612386
* @method Phaser.Polygon#clone
12387-
* @param {Phaser.Polygon} [output=(new Polygon)] - The polygon to update. If not specified a new polygon will be created.
12387+
* @param {Phaser.Polygon} [output=(new Phaser.Polygon)] - The polygon to update. If not specified a new polygon will be created.
1238812388
* @return {Phaser.Polygon} The cloned (`output`) polygon object.
1238912389
*/
1239012390
clone: function (output) {
@@ -15662,15 +15662,10 @@ Phaser.StateManager.prototype = {
1566215662
/**
1566315663
* @method Phaser.StateManager#loadComplete
1566415664
* @protected
15665+
* @see Phaser.StateManager#preUpdate
1566515666
*/
1566615667
loadComplete: function () {
1566715668

15668-
// Make sure to do load-update one last time before state is set to _created
15669-
if (this._created === false && this.onLoadUpdateCallback)
15670-
{
15671-
this.onLoadUpdateCallback.call(this.callbackContext, this.game);
15672-
}
15673-
1567415669
if (this._created === false && this.onCreateCallback)
1567515670
{
1567615671
this._created = true;
@@ -15683,6 +15678,20 @@ Phaser.StateManager.prototype = {
1568315678

1568415679
},
1568515680

15681+
/**
15682+
* @method Phaser.StateManager#loadUpdate
15683+
* @protected
15684+
* @see Phaser.Loader#finishedLoading
15685+
*/
15686+
loadUpdate: function () {
15687+
15688+
if (this._created === false && this.onLoadUpdateCallback)
15689+
{
15690+
this.onLoadUpdateCallback.call(this.callbackContext, this.game);
15691+
}
15692+
15693+
},
15694+
1568615695
/**
1568715696
* @method Phaser.StateManager#pause
1568815697
* @protected
@@ -21432,7 +21441,7 @@ Object.defineProperty(Phaser.World.prototype, "randomY", {
2143221441
* For example a Sprite has a `game` property, allowing you to talk to the various parts
2143321442
* of Phaser directly, without having to look after your own references.
2143421443
*
21435-
* In it's most simplest form, a Phaser game can be created by providing the arguments
21444+
* In its most simplest form, a Phaser game can be created by providing the arguments
2143621445
* to the constructor:
2143721446
*
2143821447
* ```javascript
@@ -24562,7 +24571,13 @@ Phaser.Mouse.prototype = {
2456224571
this.input.mousePointer.stop(event);
2456324572
}
2456424573

24565-
this.input.interactiveItems.callAll('_pointerOutHandler', this.input.mousePointer);
24574+
for (var i in this.input.interactiveItems.list)
24575+
{
24576+
if (this.input.interactiveItems.list[i].enabled === true)
24577+
{
24578+
this.input.interactiveItems.list[i]._pointerOutHandler(this.input.mousePointer);
24579+
}
24580+
}
2456624581

2456724582
},
2456824583

@@ -28514,7 +28529,7 @@ Phaser.InputHandler.prototype = {
2851428529
return false;
2851528530
}
2851628531

28517-
var pointerLocalCoord = this.globalToLocal(pointer);
28532+
var pointerLocalCoord = this.globalToLocal(pointer);
2851828533

2851928534
if (this.sprite.fixedToCamera)
2852028535
{
@@ -28794,7 +28809,7 @@ Phaser.InputHandler.prototype = {
2879428809

2879528810
var x = this.sprite.x;
2879628811
var y = this.sprite.y;
28797-
var pointerLocalCoord = this.globalToLocal(pointer);
28812+
var pointerLocalCoord = this.globalToLocal(pointer);
2879828813

2879928814
this.isDragged = true;
2880028815
this._draggedPointerID = pointer.id;
@@ -28809,7 +28824,7 @@ Phaser.InputHandler.prototype = {
2880928824
if (this.dragFromCenter)
2881028825
{
2881128826
var bounds = this.sprite.getBounds();
28812-
var boundsCenterLocalCoord = this.globalToLocal(new Phaser.Point(bounds.centerX, bounds.centerY));
28827+
var boundsCenterLocalCoord = this.globalToLocal(new Phaser.Point(bounds.centerX, bounds.centerY));
2881328828

2881428829
this.sprite.cameraOffset.x = pointerLocalCoord.x + (this.sprite.cameraOffset.x - boundsCenterLocalCoord.x);
2881528830
this.sprite.cameraOffset.y = pointerLocalCoord.y + (this.sprite.cameraOffset.y - boundsCenterLocalCoord.y);
@@ -28822,7 +28837,7 @@ Phaser.InputHandler.prototype = {
2882228837
if (this.dragFromCenter)
2882328838
{
2882428839
var bounds = this.sprite.getBounds();
28825-
var boundsCenterLocalCoord = this.globalToLocal(new Phaser.Point(bounds.centerX, bounds.centerY));
28840+
var boundsCenterLocalCoord = this.globalToLocal(new Phaser.Point(bounds.centerX, bounds.centerY));
2882628841

2882728842
this.sprite.x = pointerLocalCoord.x + (this.sprite.x - boundsCenterLocalCoord.x);
2882828843
this.sprite.y = pointerLocalCoord.y + (this.sprite.y - boundsCenterLocalCoord.y);
@@ -28892,14 +28907,14 @@ Phaser.InputHandler.prototype = {
2889228907
*/
2889328908
globalToLocal: function (globalCoord) {
2889428909

28895-
if (this.sprite.parent)
28896-
{
28897-
return this.game.input.getLocalPosition(this.sprite.parent, {x: globalCoord.x, y: globalCoord.y});
28898-
}
28899-
else
28900-
{
28901-
return globalCoord;
28902-
}
28910+
if (this.sprite.parent)
28911+
{
28912+
return this.game.input.getLocalPosition(this.sprite.parent, {x: globalCoord.x, y: globalCoord.y});
28913+
}
28914+
else
28915+
{
28916+
return globalCoord;
28917+
}
2890328918

2890428919
},
2890528920

@@ -33479,7 +33494,7 @@ Phaser.Image.prototype.preUpdate = function() {
3347933494
* @param {number} [x=0] - X position of the Button.
3348033495
* @param {number} [y=0] - Y position of the Button.
3348133496
* @param {string} [key] - The image key (in the Game.Cache) to use as the texture for this Button.
33482-
* @param {function} [callback] - The function to call when this Button is pressed, receiving `this` (the Button), `pointer`, and `isOver` (see {@link Phaser.Events#onInputUp}.)
33497+
* @param {function} [callback] - The function to call when this Button is pressed, receiving `this` (the Button), `pointer` (the Pointer causing the input), and `isOver` (whether the Pointer is still on the Button). See {@link Phaser.Events#onInputUp}.
3348333498
* @param {object} [callbackContext] - The context in which the callback will be called (usually 'this').
3348433499
* @param {string|integer} [overFrame] - The frame / frameName when the button is in the Over state.
3348533500
* @param {string|integer} [outFrame] - The frame / frameName when the button is in the Out state.
@@ -33596,24 +33611,28 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame,
3359633611
/**
3359733612
* The Signal (or event) dispatched when this Button is in an Over state.
3359833613
* @property {Phaser.Signal} onInputOver
33614+
* @see Phaser.Events#onInputOver
3359933615
*/
3360033616
this.onInputOver = new Phaser.Signal();
3360133617

3360233618
/**
3360333619
* The Signal (or event) dispatched when this Button is in an Out state.
3360433620
* @property {Phaser.Signal} onInputOut
33621+
* @see Phaser.Events#onInputOut
3360533622
*/
3360633623
this.onInputOut = new Phaser.Signal();
3360733624

3360833625
/**
3360933626
* The Signal (or event) dispatched when this Button is in an Down state.
3361033627
* @property {Phaser.Signal} onInputDown
33628+
* @see Phaser.Events#onInputDown
3361133629
*/
3361233630
this.onInputDown = new Phaser.Signal();
3361333631

3361433632
/**
3361533633
* The Signal (or event) dispatched when this Button is in an Up state.
3361633634
* @property {Phaser.Signal} onInputUp
33635+
* @see Phaser.Events#onInputUp
3361733636
*/
3361833637
this.onInputUp = new Phaser.Signal();
3361933638

@@ -33995,6 +34014,7 @@ Phaser.Button.prototype.onInputDownHandler = function (sprite, pointer) {
3399534014
* @protected
3399634015
* @param {Phaser.Button} sprite - The Button that the event occurred on.
3399734016
* @param {Phaser.Pointer} pointer - The Pointer that activated the Button.
34017+
* @param {boolean} isOver - Is the Pointer still over the Game Object?
3399834018
*/
3399934019
Phaser.Button.prototype.onInputUpHandler = function (sprite, pointer, isOver) {
3400034020

@@ -34838,6 +34858,7 @@ Phaser.Device = function () {
3483834858
/**
3483934859
* @property {boolean} webAudio - Is the WebAudio API available?
3484034860
* @default
34861+
* @see http://mohayonao.github.io/web-audio-test-api/
3484134862
*/
3484234863
this.webAudio = false;
3484334864

@@ -44740,7 +44761,16 @@ Phaser.Loader = function (game) {
4474044761
this.onLoadStart = new Phaser.Signal();
4474144762

4474244763
/**
44743-
* This event is dispatched when the final file in the load queue has either loaded or failed.
44764+
* This event is dispatched when the final file in the load queue has either loaded or failed,
44765+
* before {@link #onLoadComplete} and before the loader is {@link #reset}.
44766+
*
44767+
* @property {Phaser.Signal} onBeforeLoadComplete
44768+
*/
44769+
this.onBeforeLoadComplete = new Phaser.Signal();
44770+
44771+
/**
44772+
* This event is dispatched when the final file in the load queue has either loaded or failed,
44773+
* after the loader is {@link #reset}.
4474444774
*
4474544775
* @property {Phaser.Signal} onLoadComplete
4474644776
*/
@@ -45703,14 +45733,32 @@ Phaser.Loader.prototype = {
4570345733
* and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension.
4570445734
* If you do not desire this action then provide a URL.
4570545735
*
45736+
* An image with four sprites, `margin = 1`, and `spacing = 1` looks like this:
45737+
*
45738+
* ```
45739+
* .......
45740+
* . .
45741+
* . # # .
45742+
* . .
45743+
* . # # .
45744+
* . .
45745+
* .......
45746+
*
45747+
* . margin
45748+
* spacing
45749+
* # sprite frame
45750+
* ```
45751+
*
45752+
* The first sprite frame is found at (margin + spacing) px from the top-left of the image.
45753+
*
4570645754
* @method Phaser.Loader#spritesheet
4570745755
* @param {string} key - Unique asset key of the sheet file.
4570845756
* @param {string} url - URL of the sprite sheet file. If undefined or `null` the url will be set to `<key>.png`, i.e. if `key` was "alien" then the URL will be "alien.png".
4570945757
* @param {number} frameWidth - Width in pixels of a single frame in the sprite sheet.
4571045758
* @param {number} frameHeight - Height in pixels of a single frame in the sprite sheet.
4571145759
* @param {number} [frameMax=-1] - How many frames in this sprite sheet. If not specified it will divide the whole image into frames.
45712-
* @param {number} [margin=0] - If the frames have been drawn with a margin, specify the amount here.
45713-
* @param {number} [spacing=0] - If the frames have been drawn with spacing between them, specify the amount here.
45760+
* @param {number} [margin=0] - Width of any empty space at the image edges, in addition to any `spacing`.
45761+
* @param {number} [spacing=0] - Width of any empty space between the frames, and between the frames and the `margin`. If there is space **only** between the frames, and nowhere else, use `margin` equal to `-spacing`.
4571445762
* @param {number} [skipFrames=0] - Skip a number of frames. Useful when there are multiple sprite sheets in one image.
4571545763
* @return {Phaser.Loader} This Loader instance.
4571645764
*/
@@ -46662,6 +46710,9 @@ Phaser.Loader.prototype = {
4666246710
this.onLoadStart.dispatch();
4666346711
}
4666446712

46713+
this.game.state.loadUpdate();
46714+
this.onBeforeLoadComplete.dispatch();
46715+
4666546716
this.reset();
4666646717

4666746718
this.onLoadComplete.dispatch();
@@ -49176,7 +49227,7 @@ Phaser.ScaleManager.prototype = {
4917649227
this.parentNode = target;
4917749228
this.parentIsWindow = false;
4917849229

49179-
this.getParentBounds(this._parentBounds);
49230+
this.getParentBounds(this._parentBounds, this.parentNode);
4918049231

4918149232
rect.width = this._parentBounds.width;
4918249233
rect.height = this._parentBounds.height;
@@ -49794,12 +49845,13 @@ Phaser.ScaleManager.prototype = {
4979449845
* @method Phaser.ScaleManager#getParentBounds
4979549846
* @protected
4979649847
* @param {Phaser.Rectangle} [target=(new Rectangle)] - The rectangle to update; a new one is created as needed.
49848+
* @param {HTMLElement} [parent] - Ignore {@link #boundingParent} and use this node instead.
4979749849
* @return {Phaser.Rectangle} The established parent bounds.
4979849850
*/
49799-
getParentBounds: function (target) {
49851+
getParentBounds: function (target, parent) {
4980049852

4980149853
var bounds = target || new Phaser.Rectangle();
49802-
var parentNode = this.boundingParent;
49854+
var parentNode = parent || this.boundingParent;
4980349855
var visualBounds = this.dom.visualBounds;
4980449856
var layoutBounds = this.dom.layoutBounds;
4980549857

0 commit comments

Comments
 (0)