mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 14:38:30 +00:00
Merge branch 'dev' into texture-compression-webgl
This commit is contained in:
commit
b84e6efbfe
6 changed files with 26 additions and 51 deletions
|
@ -331,7 +331,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
|
|||
* 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.
|
||||
* 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)
|
||||
* As a result of changes in #2573 Graphics objects were calling `updateLocalBounds` on any shape change, which could cause dramatic performances drops in Graphics heavy situations (#2618). Graphics objects now have a new flag `_boundsDirty` which is used to detect if the bounds have been invalidated, i.e. by a Graphics being cleared or drawn to. If this is set to true then `updateLocalBounds` is called once in the `postUpdate` method (thanks @pengchuan #2618)
|
||||
|
||||
* Phaser.Image now has the ScaleMinMax component.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
|
@ -339,6 +339,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
|
|||
* Weapon.autofire wouldn't fire after the first bullet, or until `fire` was called, neither of which are requirements. If you now set this boolean the Weapon will fire continuously until you toggle it back to false (thanks @alverLopez #2647)
|
||||
* ArcadePhysics.World.angleBetweenCenters now uses `centerX` and `centerY` properties to check for the angle between, instead of `center.x/y` as that property no longer exists (thanks @leopoldobrines7 #2654)
|
||||
* The Emitter.makeParticles `collide` argument didn't work, as a result of #2661, but is now properly respected thanks to that change (thanks @samme #2662)
|
||||
* Sound.play would throw the error "Uncaught DOMException: Failed to execute 'disconnect' on 'AudioNode': the given destination is not connected." in Chrome, if you tried to play an audio marker that didn't exist, while a valid marker was already playing.
|
||||
|
||||
### Pixi Updates
|
||||
|
||||
|
|
|
@ -2711,11 +2711,6 @@ Object.defineProperty(Phaser.Group.prototype, "angle", {
|
|||
* It is derived by calling `getBounds`, calculating the Groups dimensions based on its
|
||||
* visible children.
|
||||
*
|
||||
* Note that no ancestors are factored into the result, meaning that if this Group is
|
||||
* nested within another Group, with heavy transforms on it, the result of this property
|
||||
* is likely to be incorrect. It is safe to get and set this property if the Group is a
|
||||
* top-level descendant of Phaser.World, or untransformed parents.
|
||||
*
|
||||
* @name Phaser.Group#centerX
|
||||
* @property {number} centerX
|
||||
*/
|
||||
|
@ -2723,13 +2718,13 @@ Object.defineProperty(Phaser.Group.prototype, "centerX", {
|
|||
|
||||
get: function () {
|
||||
|
||||
return this.getBounds().centerX;
|
||||
return this.getBounds(this.parent).centerX;
|
||||
|
||||
},
|
||||
|
||||
set: function (value) {
|
||||
|
||||
var r = this.getBounds();
|
||||
var r = this.getBounds(this.parent);
|
||||
var offset = this.x - r.x;
|
||||
|
||||
this.x = (value + offset) - r.halfWidth;
|
||||
|
@ -2744,11 +2739,6 @@ Object.defineProperty(Phaser.Group.prototype, "centerX", {
|
|||
* It is derived by calling `getBounds`, calculating the Groups dimensions based on its
|
||||
* visible children.
|
||||
*
|
||||
* Note that no ancestors are factored into the result, meaning that if this Group is
|
||||
* nested within another Group, with heavy transforms on it, the result of this property
|
||||
* is likely to be incorrect. It is safe to get and set this property if the Group is a
|
||||
* top-level descendant of Phaser.World, or untransformed parents.
|
||||
*
|
||||
* @name Phaser.Group#centerY
|
||||
* @property {number} centerY
|
||||
*/
|
||||
|
@ -2756,13 +2746,13 @@ Object.defineProperty(Phaser.Group.prototype, "centerY", {
|
|||
|
||||
get: function () {
|
||||
|
||||
return this.getBounds().centerY;
|
||||
return this.getBounds(this.parent).centerY;
|
||||
|
||||
},
|
||||
|
||||
set: function (value) {
|
||||
|
||||
var r = this.getBounds();
|
||||
var r = this.getBounds(this.parent);
|
||||
var offset = this.y - r.y;
|
||||
|
||||
this.y = (value + offset) - r.halfHeight;
|
||||
|
@ -2777,11 +2767,6 @@ Object.defineProperty(Phaser.Group.prototype, "centerY", {
|
|||
* It is derived by calling `getBounds`, calculating the Groups dimensions based on its
|
||||
* visible children.
|
||||
*
|
||||
* Note that no ancestors are factored into the result, meaning that if this Group is
|
||||
* nested within another Group, with heavy transforms on it, the result of this property
|
||||
* is likely to be incorrect. It is safe to get and set this property if the Group is a
|
||||
* top-level descendant of Phaser.World, or untransformed parents.
|
||||
*
|
||||
* @name Phaser.Group#left
|
||||
* @property {number} left
|
||||
*/
|
||||
|
@ -2789,13 +2774,13 @@ Object.defineProperty(Phaser.Group.prototype, "left", {
|
|||
|
||||
get: function () {
|
||||
|
||||
return this.getBounds().left;
|
||||
return this.getBounds(this.parent).left;
|
||||
|
||||
},
|
||||
|
||||
set: function (value) {
|
||||
|
||||
var r = this.getBounds();
|
||||
var r = this.getBounds(this.parent);
|
||||
var offset = this.x - r.x;
|
||||
|
||||
this.x = value + offset;
|
||||
|
@ -2809,11 +2794,6 @@ Object.defineProperty(Phaser.Group.prototype, "left", {
|
|||
*
|
||||
* It is derived by calling `getBounds`, calculating the Groups dimensions based on its
|
||||
* visible children.
|
||||
*
|
||||
* Note that no ancestors are factored into the result, meaning that if this Group is
|
||||
* nested within another Group, with heavy transforms on it, the result of this property
|
||||
* is likely to be incorrect. It is safe to get and set this property if the Group is a
|
||||
* top-level descendant of Phaser.World, or untransformed parents.
|
||||
*
|
||||
* @name Phaser.Group#right
|
||||
* @property {number} right
|
||||
|
@ -2822,13 +2802,13 @@ Object.defineProperty(Phaser.Group.prototype, "right", {
|
|||
|
||||
get: function () {
|
||||
|
||||
return this.getBounds().right;
|
||||
return this.getBounds(this.parent).right;
|
||||
|
||||
},
|
||||
|
||||
set: function (value) {
|
||||
|
||||
var r = this.getBounds();
|
||||
var r = this.getBounds(this.parent);
|
||||
var offset = this.x - r.x;
|
||||
|
||||
this.x = (value + offset) - r.width;
|
||||
|
@ -2842,11 +2822,6 @@ Object.defineProperty(Phaser.Group.prototype, "right", {
|
|||
*
|
||||
* It is derived by calling `getBounds`, calculating the Groups dimensions based on its
|
||||
* visible children.
|
||||
*
|
||||
* Note that no ancestors are factored into the result, meaning that if this Group is
|
||||
* nested within another Group, with heavy transforms on it, the result of this property
|
||||
* is likely to be incorrect. It is safe to get and set this property if the Group is a
|
||||
* top-level descendant of Phaser.World, or untransformed parents.
|
||||
*
|
||||
* @name Phaser.Group#top
|
||||
* @property {number} top
|
||||
|
@ -2855,13 +2830,13 @@ Object.defineProperty(Phaser.Group.prototype, "top", {
|
|||
|
||||
get: function () {
|
||||
|
||||
return this.getBounds().top;
|
||||
return this.getBounds(this.parent).top;
|
||||
|
||||
},
|
||||
|
||||
set: function (value) {
|
||||
|
||||
var r = this.getBounds();
|
||||
var r = this.getBounds(this.parent);
|
||||
var offset = this.y - r.y;
|
||||
|
||||
this.y = (value + offset);
|
||||
|
@ -2876,11 +2851,6 @@ Object.defineProperty(Phaser.Group.prototype, "top", {
|
|||
* It is derived by calling `getBounds`, calculating the Groups dimensions based on its
|
||||
* visible children.
|
||||
*
|
||||
* Note that no ancestors are factored into the result, meaning that if this Group is
|
||||
* nested within another Group, with heavy transforms on it, the result of this property
|
||||
* is likely to be incorrect. It is safe to get and set this property if the Group is a
|
||||
* top-level descendant of Phaser.World, or untransformed parents.
|
||||
*
|
||||
* @name Phaser.Group#bottom
|
||||
* @property {number} bottom
|
||||
*/
|
||||
|
@ -2888,13 +2858,13 @@ Object.defineProperty(Phaser.Group.prototype, "bottom", {
|
|||
|
||||
get: function () {
|
||||
|
||||
return this.getBounds().bottom;
|
||||
return this.getBounds(this.parent).bottom;
|
||||
|
||||
},
|
||||
|
||||
set: function (value) {
|
||||
|
||||
var r = this.getBounds();
|
||||
var r = this.getBounds(this.parent);
|
||||
var offset = this.y - r.y;
|
||||
|
||||
this.y = (value + offset) - r.height;
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
* @extends Phaser.Component.LoadTexture
|
||||
* @extends Phaser.Component.Overlap
|
||||
* @extends Phaser.Component.Reset
|
||||
* @extends Phaser.Component.ScaleMinMax
|
||||
* @extends Phaser.Component.Smoothed
|
||||
* @constructor
|
||||
* @param {Phaser.Game} game - A reference to the currently running game.
|
||||
|
@ -68,6 +69,7 @@ Phaser.Component.Core.install.call(Phaser.Image.prototype, [
|
|||
'LoadTexture',
|
||||
'Overlap',
|
||||
'Reset',
|
||||
'ScaleMinMax',
|
||||
'Smoothed'
|
||||
]);
|
||||
|
||||
|
|
|
@ -435,14 +435,14 @@ PIXI.DisplayObjectContainer.prototype.getBounds = function (targetCoordinateSpac
|
|||
};
|
||||
|
||||
/**
|
||||
* Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.
|
||||
* Retrieves the non-global local bounds of the displayObjectContainer as a rectangle without any transformations. The calculation takes all visible children into consideration.
|
||||
*
|
||||
* @method getLocalBounds
|
||||
* @return {Rectangle} The rectangular bounding area
|
||||
*/
|
||||
PIXI.DisplayObjectContainer.prototype.getLocalBounds = function () {
|
||||
|
||||
return this.getBounds(this.parent);
|
||||
return this.getBounds(this);
|
||||
|
||||
};
|
||||
|
||||
|
@ -577,7 +577,7 @@ PIXI.DisplayObjectContainer.prototype._renderCanvas = function (renderSession) {
|
|||
Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', {
|
||||
|
||||
get: function() {
|
||||
return this.getLocalBounds().width;
|
||||
return this.getLocalBounds().width * this.scale.x;
|
||||
},
|
||||
|
||||
set: function(value) {
|
||||
|
@ -606,7 +606,7 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', {
|
|||
Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', {
|
||||
|
||||
get: function() {
|
||||
return this.getLocalBounds().height;
|
||||
return this.getLocalBounds().height * this.scale.y;
|
||||
},
|
||||
|
||||
set: function(value) {
|
||||
|
|
|
@ -555,6 +555,8 @@ Phaser.Sound.prototype = {
|
|||
this._sound.pause();
|
||||
this._sound.currentTime = 0;
|
||||
}
|
||||
|
||||
this.isPlaying = false;
|
||||
}
|
||||
|
||||
if (marker === '' && Object.keys(this.markers).length > 0)
|
||||
|
@ -566,10 +568,10 @@ Phaser.Sound.prototype = {
|
|||
|
||||
if (marker !== '')
|
||||
{
|
||||
this.currentMarker = marker;
|
||||
|
||||
if (this.markers[marker])
|
||||
{
|
||||
this.currentMarker = marker;
|
||||
|
||||
// Playing a marker? Then we default to the marker values
|
||||
this.position = this.markers[marker].start;
|
||||
this.volume = this.markers[marker].volume;
|
||||
|
@ -594,7 +596,7 @@ Phaser.Sound.prototype = {
|
|||
}
|
||||
else
|
||||
{
|
||||
// console.warn("Phaser.Sound.play: audio marker " + marker + " doesn't exist");
|
||||
console.warn("Phaser.Sound.play: audio marker " + marker + " doesn't exist");
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
2
typescript/pixi.comments.d.ts
vendored
2
typescript/pixi.comments.d.ts
vendored
|
@ -901,7 +901,7 @@ declare module PIXI {
|
|||
getChildIndex(child: DisplayObject): number;
|
||||
|
||||
/**
|
||||
* Retrieves the non-global local bounds of the displayObjectContainer as a rectangle. The calculation takes all visible children into consideration.
|
||||
* Retrieves the non-global local bounds of the displayObjectContainer as a rectangle without any transformations. The calculation takes all visible children into consideration.
|
||||
* @return The rectangular bounding area
|
||||
*/
|
||||
getLocalBounds(): Rectangle;
|
||||
|
|
Loading…
Add table
Reference in a new issue