Skip to content

Commit 30b5630

Browse files
committed
The z property assigned to children of a Group now starts from zero instead of 1, this is an internal change mostly but if you relied on the z property for some reason then please be aware of this (thanks pantoninho)
1 parent 3d45910 commit 30b5630

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
312312
* Text.useAdvancedWrap allows you to swap between the Basic and the Advanced word wrapping functions. In Advanced it will wrap long-words and condense and trim excess white space (thanks @soldoutactivist #1811)
313313
* The Grunt script has been updated to enhance the intro / outro and Pixi defaults. Pixi has been split into intro / outro and main blocks, so you can exclude its intro cleanly. The excludes are now bound, so if you exclude the Phaser UMD it will do the same for Pixi as well (thanks @spayton #2192)
314314
* ArcadePhysics.worldAngleToPointer will get the angle (in radians) between a display object and the pointer, taking all parent rotations into account (thanks @mattrick16 #2171)
315+
* There is new documentation on building Phaser for Webpack and a new custom build grunt option (thanks @deiga #2331)
315316

316317
### Updates
317318

@@ -343,6 +344,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
343344
* InputHandler.consumePointerEvent has been removed, as it was never used internally anyway, so was misleading (thanks @GregoryAveryWeir #2227)
344345
* Events.onDragUpdate has a new 6th property `fromStart` which is a boolean. You can determine if the event was the result of the start of a drag movement or not by polling it (#2155)
345346
* SinglePad.onDownCallback has been moved to the end of the method, so that DeviceButton.start is now called before the callback fires, meaning if you check the status of the button in the onDownCallback it will now be fully activated (thanks @suicidepills #2159)
347+
* The `z` property assigned to children of a Group now starts from zero instead of 1, this is an internal change mostly but if you relied on the `z` property for some reason then please be aware of this (thanks pantoninho)
346348

347349
### Bug Fixes
348350

src/core/Group.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,10 @@ Phaser.Group.prototype.add = function (child, silent) {
294294
child.parent.removeFromHash(child);
295295
}
296296

297-
this.addChild(child);
298-
299297
child.z = this.children.length;
300298

299+
this.addChild(child);
300+
301301
if (this.enableBody && child.body === null)
302302
{
303303
this.game.physics.enable(child, this.physicsBodyType);
@@ -496,10 +496,10 @@ Phaser.Group.prototype.create = function (x, y, key, frame, exists) {
496496
child.visible = exists;
497497
child.alive = exists;
498498

499-
this.addChild(child);
500-
501499
child.z = this.children.length;
502500

501+
this.addChild(child);
502+
503503
if (this.enableBody)
504504
{
505505
this.game.physics.enable(child, this.physicsBodyType, this.enableBodyDebug);

0 commit comments

Comments
 (0)