@@ -2,19 +2,12 @@ Phaser.World = function (game) {
22
33 this . game = game ;
44
5- this . _stage = new PIXI . Stage ( 0x000000 ) ;
6- this . _stage . name = '_stage_root' ;
7-
85 this . bounds = new Phaser . Rectangle ( 0 , 0 , game . width , game . height ) ;
96
107} ;
118
129Phaser . World . prototype = {
1310
14- _stage : null ,
15- _stage : null ,
16- _length : 0 ,
17-
1811 bounds : null ,
1912 camera : null ,
2013
@@ -29,27 +22,27 @@ Phaser.World.prototype = {
2922
3023 add : function ( gameobject ) {
3124
32- this . _stage . addChild ( gameobject ) ;
25+ this . game . stage . _stage . addChild ( gameobject ) ;
3326 return gameobject ;
3427
3528 } ,
3629
3730 addAt : function ( gameobject , index ) {
3831
39- this . _stage . addChildAt ( gameobject , index ) ;
32+ this . game . stage . _stage . addChildAt ( gameobject , index ) ;
4033 return gameobject ;
4134
4235 } ,
4336
4437 getAt : function ( index ) {
4538
46- return this . _stage . getChildAt ( index ) ;
39+ return this . game . stage . _stage . getChildAt ( index ) ;
4740
4841 } ,
4942
5043 remove : function ( gameobject ) {
5144
52- this . _stage . removeChild ( gameobject ) ;
45+ this . game . stage . _stage . removeChild ( gameobject ) ;
5346 return gameobject ;
5447
5548 } ,
@@ -60,9 +53,9 @@ Phaser.World.prototype = {
6053
6154 this . currentRenderOrderID = 0 ;
6255
63- if ( this . _stage . first . _iNext )
56+ if ( this . game . stage . _stage . first . _iNext )
6457 {
65- var currentNode = this . _stage . first . _iNext ;
58+ var currentNode = this . game . stage . _stage . first . _iNext ;
6659
6760 do
6861 {
@@ -73,7 +66,7 @@ Phaser.World.prototype = {
7366
7467 currentNode = currentNode . _iNext ;
7568 }
76- while ( currentNode != this . _stage . last . _iNext )
69+ while ( currentNode != this . game . stage . _stage . last . _iNext )
7770 }
7871
7972 } ,
@@ -93,9 +86,9 @@ Phaser.World.prototype = {
9386
9487 bringToTop : function ( child ) {
9588
96- if ( child !== this . _stage . last )
89+ if ( child !== this . game . stage . _stage . last )
9790 {
98- this . swapChildren ( child , this . _stage . last ) ;
91+ this . swapChildren ( child , this . game . stage . _stage . last ) ;
9992 }
10093
10194 return child ;
@@ -116,8 +109,8 @@ Phaser.World.prototype = {
116109 var child2Prev = child2 . _iPrev ;
117110 var child2Next = child2 . _iNext ;
118111
119- var endNode = this . _stage . last . _iNext ;
120- var currentNode = this . _stage . first ;
112+ var endNode = this . game . stage . _stage . last . _iNext ;
113+ var currentNode = this . game . stage . _stage . first ;
121114
122115 do
123116 {
0 commit comments