Skip to content

Commit

Permalink
Phaser 2.7.0 Beta 2 Release.
Browse files Browse the repository at this point in the history
  • Loading branch information
photonstorm committed Jul 22, 2016
1 parent 3ba00bb commit 7de3cc2
Show file tree
Hide file tree
Showing 20 changed files with 4,664 additions and 3,687 deletions.
2 changes: 1 addition & 1 deletion build/custom/p2.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions build/custom/p2.min.js

Large diffs are not rendered by default.

2,655 changes: 1,477 additions & 1,178 deletions build/custom/phaser-arcade-physics.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/custom/phaser-arcade-physics.map

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions build/custom/phaser-arcade-physics.min.js

Large diffs are not rendered by default.

84 changes: 62 additions & 22 deletions build/custom/phaser-minimum.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* Phaser - http://phaser.io
*
* v2.6.2 "Kore Springs" - Built: Mon Jul 18 2016 23:41:16
* v2.6.2 "Kore Springs" - Built: Fri Jul 22 2016 17:03:35
*
* By Richard Davey http://www.photonstorm.com @photonstorm
*
Expand Down Expand Up @@ -7848,7 +7848,7 @@ var Phaser = Phaser || {
* @constant
* @type {string}
*/
VERSION: '2.7.0 Beta',
VERSION: '2.7.0 Beta 2',

/**
* An array of Phaser game instances.
Expand Down Expand Up @@ -10508,7 +10508,7 @@ Phaser.Line.intersects = function (a, b, asSegment, result) {
*
* The for the purposes of this function rectangles are considered 'solid'.
*
* @method intersectsRectangle
* @method Phaser.Line.intersectsRectangle
* @param {Phaser.Line} line - The line to check for intersection with.
* @param {Phaser.Rectangle|object} rect - The rectangle, or rectangle-like object, to check for intersection with.
* @return {boolean} True if the line intersects with the rectangle edges, or starts or ends within the rectangle.
Expand Down Expand Up @@ -17836,7 +17836,7 @@ Phaser.Group.prototype.updateZ = function () {
* the `alignTo` method in order to be positioned by this call. All default Phaser Game Objects have
* this.
*
* The grid dimensions are determined by the first four arguments. The `rows` and `columns` arguments
* The grid dimensions are determined by the first four arguments. The `width` and `height` arguments
* relate to the width and height of the grid respectively.
*
* For example if the Group had 100 children in it:
Expand All @@ -17850,13 +17850,13 @@ Phaser.Group.prototype.updateZ = function () {
*
* This will align the children into a grid of 25x4, again using 32 pixels per grid cell.
*
* You can choose to set _either_ the `rows` or `columns` value to -1. Doing so tells the method
* You can choose to set _either_ the `width` or `height` value to -1. Doing so tells the method
* to keep on aligning children until there are no children left. For example if this Group had
* 48 children in it, the following:
*
* `Group.align(-1, 8, 32, 32)`
*
* ... will align the children so that there are 8 columns vertically (the second argument),
* ... will align the children so that there are 8 children vertically (the second argument),
* and each row will contain 6 sprites, except the last one, which will contain 5 (totaling 48)
*
* You can also do:
Expand All @@ -17874,26 +17874,27 @@ Phaser.Group.prototype.updateZ = function () {
* The final argument; `offset` lets you start the alignment from a specific child index.
*
* @method Phaser.Group#align
* @param {integer} rows - The number of rows, or width, of the grid. Set to -1 for a dynamic width.
* @param {integer} columns - The number of columns, or height, of the grid. Set to -1 for a dynamic height.
* @param {integer} width - The width of the grid in items (not pixels). Set to -1 for a dynamic width. If -1 then you must set an explicit height value.
* @param {integer} height - The height of the grid in items (not pixels). Set to -1 for a dynamic height. If -1 then you must set an explicit width value.
* @param {integer} cellWidth - The width of each grid cell, in pixels.
* @param {integer} cellHeight - The height of each grid cell, in pixels.
* @param {integer} [position] - The position constant. One of `Phaser.TOP_LEFT` (default), `Phaser.TOP_CENTER`, `Phaser.TOP_RIGHT`, `Phaser.LEFT_CENTER`, `Phaser.CENTER`, `Phaser.RIGHT_CENTER`, `Phaser.BOTTOM_LEFT`, `Phaser.BOTTOM_CENTER` or `Phaser.BOTTOM_RIGHT`.
* @param {integer} [offset=0] - Optional index to start the alignment from. Defaults to zero, the first child in the Group, but can be set to any valid child index value.
* @return {boolean} True if the Group children were aligned, otherwise false.
*/
Phaser.Group.prototype.align = function (rows, columns, cellWidth, cellHeight, position, offset) {
Phaser.Group.prototype.align = function (width, height, cellWidth, cellHeight, position, offset) {

if (position === undefined) { position = Phaser.TOP_LEFT; }
if (offset === undefined) { offset = 0; }

if (this.children.length === 0 || offset > this.children.length || (rows === -1 && columns === -1))
if (this.children.length === 0 || offset > this.children.length || (width === -1 && height === -1))
{
return;
return false;
}

var r = new Phaser.Rectangle(0, 0, cellWidth, cellHeight);
var w = (rows * cellWidth);
var h = (columns * cellHeight);
var w = (width * cellWidth);
var h = (height * cellHeight);

for (var i = offset; i < this.children.length; i++)
{
Expand All @@ -17908,7 +17909,7 @@ Phaser.Group.prototype.align = function (rows, columns, cellWidth, cellHeight, p
continue;
}

if (rows === -1)
if (width === -1)
{
// We keep laying them out horizontally until we've done them all
r.y += cellHeight;
Expand All @@ -17919,7 +17920,7 @@ Phaser.Group.prototype.align = function (rows, columns, cellWidth, cellHeight, p
r.y = 0;
}
}
else if (columns === -1)
else if (height === -1)
{
// We keep laying them out vertically until we've done them all
r.x += cellWidth;
Expand All @@ -17943,12 +17944,14 @@ Phaser.Group.prototype.align = function (rows, columns, cellWidth, cellHeight, p
if (r.y === h)
{
// We've hit the column limit, so return, even if there are children left
return;
return true;
}
}
}
}

return true;

};

/**
Expand Down Expand Up @@ -42328,12 +42331,23 @@ Phaser.Loader = function (game) {
* Used to map the application mime-types to to the Accept header in XHR requests.
* If you don't require these mappings, or they cause problems on your server, then
* remove them from the headers object and the XHR request will not try to use them.
*
* This object can also be used to set the `X-Requested-With` header to
* `XMLHttpRequest` (or any other value you need). To enable this do:
*
* `this.load.headers.requestedWith = 'XMLHttpRequest'`
*
* before adding anything to the Loader. The XHR loader will then call:
*
* `setRequestHeader('X-Requested-With', this.headers['requestedWith'])`
*
* @property {object} headers
* @default
*/
this.headers = {
json: "application/json",
xml: "application/xml"
"requestedWith": false,
"json": "application/json",
"xml": "application/xml"
};

/**
Expand Down Expand Up @@ -43257,7 +43271,7 @@ Phaser.Loader.prototype = {
*
* The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.
*
* @method Phaser.Loader#audiosprite
* @method Phaser.Loader#audioSprite
* @param {string} key - Unique asset key of the audio file.
* @param {Array|string} urls - An array containing the URLs of the audio files, i.e.: [ 'audiosprite.mp3', 'audiosprite.ogg', 'audiosprite.m4a' ] or a single string containing just one URL.
* @param {string} [jsonURL=null] - The URL of the audiosprite configuration JSON object. If you wish to pass the data directly set this parameter to null.
Expand Down Expand Up @@ -44552,9 +44566,14 @@ Phaser.Loader.prototype = {
xhr.open("GET", url, true);
xhr.responseType = type;

if (this.headers['requestedWith'] !== false)
{
xhr.setRequestHeader('X-Requested-With', this.headers['requestedWith']);
}

if (this.headers[file.type])
{
xhr.setRequestHeader("Accept", this.headers[file.type]);
xhr.setRequestHeader('Accept', this.headers[file.type]);
}

onerror = onerror || this.fileError;
Expand Down Expand Up @@ -45688,6 +45707,18 @@ Phaser.ScaleManager = function (game, width, height) {
*/
this.leaveIncorrectOrientation = new Phaser.Signal();

/**
* This boolean provides you with a way to determine if the browser is in Full Screen
* mode (via the Full Screen API), and Phaser was the one responsible for activating it.
*
* It's possible that ScaleManager.isFullScreen returns `true` even if Phaser wasn't the
* one that made the browser go full-screen, so this flag lets you determine that.
*
* @property {boolean} hasPhaserSetFullScreen
* @default
*/
this.hasPhaserSetFullScreen = false;

/**
* If specified, this is the DOM element on which the Fullscreen API enter request will be invoked.
* The target element must have the correct CSS styling and contain the Display canvas.
Expand Down Expand Up @@ -47228,9 +47259,11 @@ Phaser.ScaleManager.prototype = {
{
// Error is called in timeout to emulate the real fullscreenerror event better
var _this = this;

setTimeout(function () {
_this.fullScreenError();
}, 10);

return;
}

Expand All @@ -47247,7 +47280,7 @@ Phaser.ScaleManager.prototype = {
}
}

if (typeof antialias !== 'undefined' && this.game.renderType === Phaser.CANVAS)
if (antialias !== undefined && this.game.renderType === Phaser.CANVAS)
{
this.game.stage.smoothed = antialias;
}
Expand All @@ -47266,6 +47299,8 @@ Phaser.ScaleManager.prototype = {
targetElement: fsTarget
};

this.hasPhaserSetFullScreen = true;

this.onFullScreenInit.dispatch(this, initData);

if (this._createdFullScreenTarget)
Expand Down Expand Up @@ -47305,6 +47340,8 @@ Phaser.ScaleManager.prototype = {
return false;
}

this.hasPhaserSetFullScreen = false;

document[this.game.device.cancelFullscreen]();

return true;
Expand Down Expand Up @@ -47551,14 +47588,17 @@ Phaser.ScaleManager.prototype.constructor = Phaser.ScaleManager;
Object.defineProperty(Phaser.ScaleManager.prototype, "boundingParent", {

get: function () {

if (this.parentIsWindow ||
(this.isFullScreen && !this._createdFullScreenTarget))
(this.isFullScreen && this.hasPhaserSetFullScreen && !this._createdFullScreenTarget))
{
return null;
}

var parentNode = this.game.canvas && this.game.canvas.parentNode;

return parentNode || null;

}

});
Expand Down
2 changes: 1 addition & 1 deletion build/custom/phaser-minimum.map

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions build/custom/phaser-minimum.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 7de3cc2

Please sign in to comment.