Skip to content

Commit

Permalink
New 2.0.7 build
Browse files Browse the repository at this point in the history
  • Loading branch information
photonstorm committed Jul 18, 2014
1 parent 24527ea commit 94978a6
Show file tree
Hide file tree
Showing 9 changed files with 749 additions and 260 deletions.
301 changes: 232 additions & 69 deletions build/custom/phaser-arcade-physics.js

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions build/custom/phaser-arcade-physics.min.js

Large diffs are not rendered by default.

163 changes: 152 additions & 11 deletions build/custom/phaser-no-libs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* Phaser - http://phaser.io
*
* v2.0.7 "Amadicia" - Built: Wed Jul 16 2014 01:57:57
* v2.0.7 "Amadicia" - Built: Fri Jul 18 2014 11:49:42
*
* By Richard Davey http://www.photonstorm.com @photonstorm
*
Expand Down Expand Up @@ -136,6 +136,70 @@ PIXI.dontSayHello = true;
*/
Phaser.Utils = {

/**
* Gets an objects property by string.
*
* @method Phaser.Utils.getProperty
* @param {object} obj - The object to traverse.
* @param {string} prop - The property whose value will be returned.
* @return {*} the value of the property or null if property isn't found .
*/
getProperty: function(obj, prop) {

var parts = prop.split('.'),
last = parts.pop(),
l = parts.length,
i = 1,
current = parts[0];

while (i < l && (obj = obj[current]))
{
current = parts[i];
i++;
}

if (obj)
{
return obj[last];
}
else
{
return null;
}

},

/**
* Sets an objects property by string.
*
* @method Phaser.Utils.setProperty
* @param {object} obj - The object to traverse
* @param {string} prop - The property whose value will be changed
* @return {object} The object on which the property was set.
*/
setProperty: function(obj, prop, value) {

var parts = prop.split('.'),
last = parts.pop(),
l = parts.length,
i = 1,
current = parts[0];

while (i < l && (obj = obj[current]))
{
current = parts[i];
i++;
}

if (obj)
{
obj[last] = value;
}

return obj;

},

/**
* Transposes the elements of the given Array.
*
Expand Down Expand Up @@ -7666,6 +7730,35 @@ Phaser.Group.prototype.setProperty = function (child, key, value, operation, for

};

/**
* Checks a property for the given value on the child.
*
* @method Phaser.Group#checkProperty
* @param {*} child - The child to check the property value on.
* @param {array} key - An array of strings that make up the property that will be set.
* @param {*} value - The value that will be checked.
* @param {boolean} [force=false] - If `force` is true then the property will be checked on the child regardless if it already exists or not. If true and the property doesn't exist, false will be returned.
* @return {boolean} True if the property was was equal to value, false if not.
*/
Phaser.Group.prototype.checkProperty = function (child, key, value, force) {

if (typeof force === 'undefined') { force = false; }

// We can't force a property in and the child doesn't have it, so abort.
if (!Phaser.Utils.getProperty(child, key) && force)
{
return false;
}

if (Phaser.Utils.getProperty(child, key) !== value)
{
return false;
}

return true;

};

/**
* This function allows you to quickly set a property on a single child of this Group to a new value.
* The operation parameter controls how the new value is assigned to the property, from simple replacement to addition and multiplication.
Expand Down Expand Up @@ -7771,6 +7864,38 @@ Phaser.Group.prototype.setAllChildren = function (key, value, checkAlive, checkV

};

/**
* This function allows you to quickly check that the same property across all children of this Group is equal to the given value.
* 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.
*
* @method Phaser.Group#checkAll
* @param {string} key - The property, as a string, to be set. For example: 'body.velocity.x'
* @param {*} value - The value that will be checked.
* @param {boolean} [checkAlive=false] - If set then only children with alive=true will be checked. This includes any Groups that are children.
* @param {boolean} [checkVisible=false] - If set then only children with visible=true will be checked. This includes any Groups that are children.
* @param {boolean} [force=false] - If `force` is true then the property will be checked on the child regardless if it already exists or not. If true and the property doesn't exist, false will be returned.
*/
Phaser.Group.prototype.checkAll = function (key, value, checkAlive, checkVisible, force) {

if (typeof checkAlive === 'undefined') { checkAlive = false; }
if (typeof checkVisible === 'undefined') { checkVisible = false; }
if (typeof force === 'undefined') { force = false; }

for (var i = 0, len = this.children.length; i < len; i++)
{
if ((!checkAlive || (checkAlive && this.children[i].alive)) && (!checkVisible || (checkVisible && this.children[i].visible)))
{
if (!this.checkProperty(this.children[i], key, value, force))
{
return false;
}
}
}

return true;

};

/**
* Adds the amount to the given property on all children in this Group.
* Group.addAll('x', 10) will add 10 to the child.x value.
Expand Down Expand Up @@ -9358,7 +9483,7 @@ Phaser.ScaleManager.prototype = {
orientationImage = '__default';
}

this.orientationSprite = new Phaser.Image(this.game, this.game.width / 2, this.game.height / 2, PIXI.TextureCache[orientationImage]);
this.orientationSprite = new Phaser.Image(this.game, this.game.width / 2, this.game.height / 2, orientationImage);
this.orientationSprite.anchor.set(0.5);

this.checkOrientationState();
Expand Down Expand Up @@ -18379,6 +18504,9 @@ Phaser.BitmapData.prototype = {
this.texture.width = width;
this.texture.height = height;

this.texture.crop.width = width;
this.texture.crop.height = height;

this.refreshBuffer();
this.dirty = true;
}
Expand Down Expand Up @@ -28957,6 +29085,15 @@ Phaser.TweenManager.prototype = {
{
this._tweens[i].pendingDelete = true;
}
else
{
i = this._add.indexOf(tween);

if (i !== -1)
{
this._add[i].pendingDelete = true;
}
}

},

Expand All @@ -28968,13 +29105,15 @@ Phaser.TweenManager.prototype = {
*/
update: function () {

if (this._tweens.length === 0 && this._add.length === 0)
var addTweens = this._add.length;
var numTweens = this._tweens.length;

if (numTweens === 0 && addTweens === 0)
{
return false;
}

var i = 0;
var numTweens = this._tweens.length;

while (i < numTweens)
{
Expand All @@ -28991,7 +29130,7 @@ Phaser.TweenManager.prototype = {
}

// If there are any new tweens to be added, do so now - otherwise they can be spliced out of the array before ever running
if (this._add.length > 0)
if (addTweens > 0)
{
this._tweens = this._tweens.concat(this._add);
this._add.length = 0;
Expand Down Expand Up @@ -31895,6 +32034,7 @@ Phaser.AnimationManager.prototype = {

this.currentAnim = this._anims[name];
this.currentAnim.paused = false;
this.currentFrame = this.currentAnim.currentFrame;
return this.currentAnim.play(frameRate, loop, killOnComplete);
}
}
Expand Down Expand Up @@ -32702,7 +32842,7 @@ Phaser.Animation.prototype = {
updateFrameData: function (frameData) {

this._frameData = frameData;
this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);
this.currentFrame = this._frameData ? this._frameData.getFrame(this._frames[this._frameIndex % this._frames.length]) : null;

},

Expand Down Expand Up @@ -45777,17 +45917,18 @@ Phaser.Tilemap.prototype = {
* @method Phaser.Tilemap#swapHandler
* @private
* @param {number} value
* @param {number} index
*/
swapHandler: function (value, index) {
swapHandler: function (value) {

if (value.index === this._tempA)
{
this._results[index].index = this._tempB;
// Swap A with B
value.index = this._tempB;
}
if (value.index === this._tempB)
else if (value.index === this._tempB)
{
this._results[index].index = this._tempA;
// Swap B with A
value.index = this._tempA;
}

},
Expand Down
24 changes: 12 additions & 12 deletions build/custom/phaser-no-libs.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 94978a6

Please sign in to comment.