You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-2Lines changed: 15 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -327,6 +327,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
327
327
* The Loader.headers object has a new property `requestedWith`. By default this is set to `false`, but it can 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.
328
328
* ScaleManager.hasPhaserSetFullScreen is a new boolean that identifies if the browser is in full screen mode or not, and if Phaser was the one that requested it. As it's possible to enter full screen mode outside of Phaser, and it then gets confused about what bounding parent to use.
329
329
* Phaser.Tileset has a new property `lastgid` which is populated automatically by the TilemapParser when importing Tiled map data, or can be set manually if building your own tileset.
330
+
* Stage will now check if `document.hidden` is available first, and if it is then never even check for the prefixed versions. This stops warnings like "mozHidden and mozVisibilityState are deprecated" in newer versions of browsers and retain backward compatibility (thanks @leopoldobrines7#2656)
330
331
331
332
### Bug Fixes
332
333
@@ -339,8 +340,20 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
339
340
340
341
Please note that Phaser uses a custom build of Pixi and always has done. The following changes have been made to our custom build, not to Pixi in general.
341
342
342
-
*
343
-
*
343
+
* This version contains significant fixes for `DisplayObject.getBounds` and `DisplayObjectContainer.getBounds`. The methods can now accept an optional argument `targetCoordinateSpace` which makes it much more flexible, allowing you to check the bounds against any target, not just local and global ones. If the `targetCoordinateSpace` is a valid DisplayObject:
344
+
345
+
- If it's a parent of the caller at some level it will return the bounds
346
+
relative to it.
347
+
- if it's not parenting the caller at all, it will get the global bounds of
348
+
it, and the caller and will calculate the x and y bounds of the caller
349
+
relative to the targetCoordinateSpace DisplayObject.
350
+
351
+
As a result this also fixes how empty Groups are treated when they have no other
352
+
children except Groups. So now calculations are correct.
353
+
* DisplayObjectContainer.contains(child) is a new method which determines whether the specified display object is a child of the DisplayObjectContainer instance or the instance itself. This method is
354
+
used in the new getBounds function.
355
+
* Corrected DisplayObjects default `_bounds` rect from (0, 0, 1, 1) to (0, 0, 0, 0).
356
+
* Thanks to @fmflame for his hard work on the above (#2639#2627)
344
357
*
345
358
346
359
For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md).
0 commit comments