Skip to content

Commit df4debf

Browse files
committed
Build update for testing.
1 parent 11fdd62 commit df4debf

7 files changed

Lines changed: 242 additions & 59 deletions

File tree

build/custom/phaser-no-libs.js

Lines changed: 73 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Phaser - http://www.phaser.io
99
*
10-
* v2.0.1 "Aes Sedai" - Built: Tue Mar 18 2014 18:36:17
10+
* v2.0.1 "Aes Sedai" - Built: Wed Mar 19 2014 00:56:48
1111
*
1212
* By Richard Davey http://www.photonstorm.com @photonstorm
1313
*
@@ -3912,7 +3912,7 @@ Phaser.StateManager.prototype = {
39123912
{
39133913
this.game.tweens.removeAll();
39143914

3915-
this.game.world.destroy();
3915+
this.game.world.shutdown();
39163916

39173917
this.game.physics.clear();
39183918

@@ -6390,6 +6390,7 @@ Phaser.Group.prototype.getIndex = function (child) {
63906390
* @method Phaser.Group#replace
63916391
* @param {*} oldChild - The child in this Group that will be replaced.
63926392
* @param {*} newChild - The child to be inserted into this Group.
6393+
* @return {*} Returns the oldChild that was replaced within this Group.
63936394
*/
63946395
Phaser.Group.prototype.replace = function (oldChild, newChild) {
63956396

@@ -6408,9 +6409,13 @@ Phaser.Group.prototype.replace = function (oldChild, newChild) {
64086409
}
64096410
}
64106411

6411-
this.removeChild(oldChild);
6412+
var temp = oldChild;
6413+
6414+
this.remove(temp);
64126415

64136416
this.addAt(newChild, index);
6417+
6418+
return temp;
64146419
}
64156420

64166421
}
@@ -7249,12 +7254,14 @@ Phaser.Group.prototype.removeBetween = function (startIndex, endIndex) {
72497254
*
72507255
* @method Phaser.Group#destroy
72517256
* @param {boolean} [destroyChildren=true] - Should every child of this Group have its destroy method called?
7257+
* @param {boolean} [soft=false] - A 'soft destroy' (set to true) doesn't remove this Group from its parent or null the game reference. Set to false and it does.
72527258
*/
7253-
Phaser.Group.prototype.destroy = function (destroyChildren) {
7259+
Phaser.Group.prototype.destroy = function (destroyChildren, soft) {
72547260

72557261
if (this.game === null) { return; }
72567262

72577263
if (typeof destroyChildren === 'undefined') { destroyChildren = true; }
7264+
if (typeof soft === 'undefined') { soft = false; }
72587265

72597266
if (destroyChildren)
72607267
{
@@ -7275,13 +7282,16 @@ Phaser.Group.prototype.destroy = function (destroyChildren) {
72757282
this.removeAll();
72767283
}
72777284

7278-
this.parent.removeChild(this);
7285+
this.cursor = null;
72797286

7280-
this.game = null;
7287+
if (!soft)
7288+
{
7289+
this.parent.removeChild(this);
72817290

7282-
this.exists = false;
7291+
this.game = null;
72837292

7284-
this.cursor = null;
7293+
this.exists = false;
7294+
}
72857295

72867296
}
72877297

@@ -7493,15 +7503,16 @@ Phaser.World.prototype.setBounds = function (x, y, width, height) {
74937503

74947504
/**
74957505
* Destroyer of worlds.
7496-
* @method Phaser.World#destroy
7506+
* @method Phaser.World#shutdown
74977507
*/
7498-
Phaser.World.prototype.destroy = function () {
7508+
Phaser.World.prototype.shutdown = function () {
74997509

75007510
this.camera.reset();
75017511

75027512
this.game.input.reset(true);
75037513

7504-
this.removeAll();
7514+
// World is a Group, so run a soft destruction on this and all children.
7515+
this.destroy(true, true);
75057516

75067517
}
75077518

@@ -11732,7 +11743,7 @@ Phaser.Pointer.prototype = {
1173211743
do
1173311744
{
1173411745
// If the object is using pixelPerfect checks, or has a higher InputManager.PriorityID OR if the priority ID is the same as the current highest AND it has a higher renderOrderID, then set it to the top
11735-
if (currentNode.pixelPerfectClick || currentNode.pixelPerfectOver || currentNode.priorityID > this._highestInputPriorityID || (currentNode.priorityID === this._highestInputPriorityID && currentNode.sprite._cache[3] < this._highestRenderOrderID))
11746+
if (currentNode.validForInput(this._highestInputPriorityID, this._highestRenderOrderID))
1173611747
{
1173711748
if ((!fromClick && currentNode.checkPointerOver(this)) || (fromClick && currentNode.checkPointerDown(this)))
1173811749
{
@@ -13742,6 +13753,12 @@ Phaser.InputHandler = function (sprite) {
1374213753
*/
1374313754
this.useHandCursor = false;
1374413755

13756+
/**
13757+
* @property {boolean} _setHandCursor - Did this Sprite trigger the hand cursor?
13758+
* @private
13759+
*/
13760+
this._setHandCursor = false;
13761+
1374513762
/**
1374613763
* @property {boolean} isDragged - true if the Sprite is being currently dragged.
1374713764
* @default
@@ -14004,6 +14021,12 @@ Phaser.InputHandler.prototype = {
1400414021

1400514022
if (this.enabled)
1400614023
{
14024+
if (this._setHandCursor)
14025+
{
14026+
this.game.canvas.style.cursor = "default";
14027+
this._setHandCursor = false;
14028+
}
14029+
1400714030
this.enabled = false;
1400814031

1400914032
this.game.input.interactiveItems.remove(this);
@@ -14016,6 +14039,37 @@ Phaser.InputHandler.prototype = {
1401614039

1401714040
},
1401814041

14042+
/**
14043+
* Checks if the object this InputHandler is bound to is valid for consideration in the Pointer move event.
14044+
* This is called by Phaser.Pointer and shouldn't typically be called directly.
14045+
*
14046+
* @method Phaser.InputHandler#validForInput
14047+
* @protected
14048+
* @param {number} highestID - The highest ID currently processed by the Pointer.
14049+
* @param {number} highestRenderID - The highest Render Order ID currently processed by the Pointer.
14050+
* @return {boolean} True if the object this InputHandler is bound to should be considered as valid for input detection.
14051+
*/
14052+
validForInput: function (highestID, highestRenderID) {
14053+
14054+
if (this.sprite.scale.x === 0 || this.sprite.scale.y === 0)
14055+
{
14056+
return false;
14057+
}
14058+
14059+
if (this.pixelPerfectClick || this.pixelPerfectOver)
14060+
{
14061+
return true;
14062+
}
14063+
14064+
if (this.priorityID > highestID || (this.priorityID === highestID && this.sprite._cache[3] < highestRenderID))
14065+
{
14066+
return true;
14067+
}
14068+
14069+
return false;
14070+
14071+
},
14072+
1401914073
/**
1402014074
* The x coordinate of the Input pointer, relative to the top-left of the parent Sprite.
1402114075
* This value is only set when the pointer is over this Sprite.
@@ -14381,6 +14435,7 @@ Phaser.InputHandler.prototype = {
1438114435
if (this.useHandCursor && this._pointerData[pointer.id].isDragged === false)
1438214436
{
1438314437
this.game.canvas.style.cursor = "pointer";
14438+
this._setHandCursor = false;
1438414439
}
1438514440

1438614441
this.sprite.events.onInputOver.dispatch(this.sprite, pointer);
@@ -14409,6 +14464,7 @@ Phaser.InputHandler.prototype = {
1440914464
if (this.useHandCursor && this._pointerData[pointer.id].isDragged === false)
1441014465
{
1441114466
this.game.canvas.style.cursor = "default";
14467+
this._setHandCursor = false;
1441214468
}
1441314469

1441414470
if (this.sprite && this.sprite.events)
@@ -14498,6 +14554,7 @@ Phaser.InputHandler.prototype = {
1449814554
if (this.useHandCursor)
1449914555
{
1450014556
this.game.canvas.style.cursor = "default";
14557+
this._setHandCursor = false;
1450114558
}
1450214559
}
1450314560

@@ -18588,6 +18645,10 @@ Phaser.Text = function (game, x, y, text, style) {
1858818645
{
1858918646
text = ' ';
1859018647
}
18648+
else
18649+
{
18650+
text = text.toString();
18651+
}
1859118652

1859218653
/**
1859318654
* @property {Phaser.Game} game - A reference to the currently running Game.

build/custom/phaser-no-libs.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)