@@ -20,7 +20,8 @@ Phaser.Stage = function (game) {
2020 */
2121 this . game = game ;
2222
23- PIXI . DisplayObjectContainer . call ( this ) ;
23+ // PIXI.DisplayObjectContainer.call(this);
24+ Phaser . GameObject . Container . call ( this , game ) ;
2425
2526 /**
2627 * @property {string } name - The name of this object.
@@ -43,14 +44,14 @@ Phaser.Stage = function (game) {
4344 * @property {boolean } exists - If exists is true the Stage and all children are updated, otherwise it is skipped.
4445 * @default
4546 */
46- this . exists = true ;
47+ // this.exists = true;
4748
4849 /**
4950 * @property {Phaser.Matrix } worldTransform - Current transform of the object based on world (parent) factors
5051 * @private
5152 * @readOnly
5253 */
53- this . worldTransform = new Phaser . Matrix ( ) ;
54+ // this.worldTransform = new Phaser.Matrix();
5455
5556 /**
5657 * @property {Phaser.Stage } stage - The stage reference (the Stage is its own stage)
@@ -95,7 +96,8 @@ Phaser.Stage = function (game) {
9596
9697} ;
9798
98- Phaser . Stage . prototype = Object . create ( PIXI . DisplayObjectContainer . prototype ) ;
99+ // Phaser.Stage.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
100+ Phaser . Stage . prototype = Object . create ( Phaser . GameObject . Container . prototype ) ;
99101Phaser . Stage . prototype . constructor = Phaser . Stage ;
100102
101103/**
@@ -143,12 +145,14 @@ Phaser.Stage.prototype.boot = function () {
143145*/
144146Phaser . Stage . prototype . preUpdate = function ( ) {
145147
148+ this . transform . update ( ) ;
149+
146150 this . currentRenderOrderID = 0 ;
147151
148152 // This can't loop in reverse, we need the renderOrderID to be in sequence
149- for ( var i = 0 ; i < this . children . length ; i ++ )
153+ for ( var i = 0 ; i < this . children . list . length ; i ++ )
150154 {
151- this . children [ i ] . preUpdate ( ) ;
155+ this . children . list [ i ] . preUpdate ( ) ;
152156 }
153157
154158} ;
@@ -161,11 +165,11 @@ Phaser.Stage.prototype.preUpdate = function () {
161165Phaser . Stage . prototype . update = function ( ) {
162166
163167 // Goes in reverse, because it's highly likely the child will destroy itself in `update`
164- var i = this . children . length ;
168+ var i = this . children . list . length ;
165169
166170 while ( i -- )
167171 {
168- this . children [ i ] . update ( ) ;
172+ this . children . list [ i ] . update ( ) ;
169173 }
170174
171175} ;
@@ -179,6 +183,7 @@ Phaser.Stage.prototype.update = function () {
179183*/
180184Phaser . Stage . prototype . postUpdate = function ( ) {
181185
186+ /*
182187 // Apply the camera shake, fade, bounds, etc
183188 this.game.camera.update();
184189
@@ -191,13 +196,14 @@ Phaser.Stage.prototype.postUpdate = function () {
191196
192197 this.game.camera.updateTarget();
193198 }
199+ */
194200
195- for ( var i = 0 ; i < this . children . length ; i ++ )
201+ for ( var i = 0 ; i < this . children . list . length ; i ++ )
196202 {
197- this . children [ i ] . postUpdate ( ) ;
203+ this . children . list [ i ] . postUpdate ( ) ;
198204 }
199205
200- this . updateTransform ( ) ;
206+ // this.updateTransform();
201207
202208} ;
203209
@@ -209,12 +215,12 @@ Phaser.Stage.prototype.postUpdate = function () {
209215*/
210216Phaser . Stage . prototype . updateTransform = function ( ) {
211217
212- this . worldAlpha = 1 ;
218+ // this.worldAlpha = 1;
213219
214- for ( var i = 0 ; i < this . children . length ; i ++ )
215- {
216- this . children [ i ] . updateTransform ( ) ;
217- }
220+ // for (var i = 0; i < this.children.length; i++)
221+ // {
222+ // this.children[i].updateTransform();
223+ // }
218224
219225} ;
220226
0 commit comments