Skip to content

Commit b69cae4

Browse files
committed
The methods setStageReference and removeStageReference have been removed from all Pixi classes. Objects no longer have stage properties, or references to the Stage object. This is because no reference to the Stage is required for any calculations, and Phaser can only have 1 Stage, so adding and removing references to it were superfluous actions.
1 parent ce764e0 commit b69cae4

7 files changed

Lines changed: 213 additions & 229 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ children except Groups. So now calculations are correct.
356356
used in the new getBounds function.
357357
* Corrected DisplayObjects default `_bounds` rect from (0, 0, 1, 1) to (0, 0, 0, 0).
358358
* Thanks to @fmflame for his hard work on the above (#2639 #2627)
359-
*
359+
* The methods `setStageReference` and `removeStageReference` have been removed from all Pixi classes. Objects no longer have `stage` properties, or references to the Stage object. This is because no reference to the Stage is required for any calculations, and Phaser can only have 1 Stage, so adding and removing references to it were superfluous actions.
360360

361361
For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md).
362362

src/pixi/display/DisplayObject.js

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* @class PIXI.DisplayObject
1616
* @constructor
1717
*/
18-
PIXI.DisplayObject = function() {
18+
PIXI.DisplayObject = function () {
1919

2020
/**
2121
* The coordinates, in pixels, of this DisplayObject, relative to its parent container.
@@ -116,15 +116,6 @@ PIXI.DisplayObject = function() {
116116
*/
117117
this.parent = null;
118118

119-
/**
120-
* The stage that this DisplayObject is connected to.
121-
*
122-
* @property {PIXI.Stage} stage
123-
* @default
124-
* @readOnly
125-
*/
126-
this.stage = null;
127-
128119
/**
129120
* The multiplied alpha value of this DisplayObject. A value of 1 is fully opaque. A value of 0 is transparent.
130121
* This value is the calculated total, based on the alpha values of all parents of this DisplayObjects
@@ -261,8 +252,7 @@ PIXI.DisplayObject.prototype = {
261252
/**
262253
* Destroy this DisplayObject.
263254
*
264-
* Removes any cached sprites, sets renderable flag to false, and nulls references to the Stage, filters,
265-
* bounds and mask.
255+
* Removes any cached sprites, sets renderable flag to false, and nulls filters, bounds and mask.
266256
*
267257
* Also iteratively calls `destroy` on any children.
268258
*
@@ -284,7 +274,6 @@ PIXI.DisplayObject.prototype = {
284274

285275
this.hitArea = null;
286276
this.parent = null;
287-
this.stage = null;
288277
this.worldTransform = null;
289278
this.filterArea = null;
290279
this.renderable = false;
@@ -411,21 +400,6 @@ PIXI.DisplayObject.prototype = {
411400

412401
},
413402

414-
/**
415-
* Sets the root Stage object that this DisplayObject is connected to.
416-
*
417-
* @method PIXI.DisplayObject#setStageReference
418-
* @param {Phaser.Stage} stage - The stage that the object will have as its current stage reference
419-
* @return {PIXI.DisplayObject} - A reference to this DisplayObject.
420-
*/
421-
setStageReference: function (stage)
422-
{
423-
this.stage = stage;
424-
425-
return this;
426-
427-
},
428-
429403
/**
430404
* To be overridden by classes that require it.
431405
*

0 commit comments

Comments
 (0)