@@ -24,82 +24,88 @@ var GameObjectFactory = new Class({
2424 {
2525 this . state = state ;
2626
27- this . children = state . sys . children ;
27+ this . displayList = state . sys . displayList ;
28+ this . updateList = state . sys . updateList ;
2829 } ,
2930
3031 bitmapText : function ( x , y , font , text , size , align )
3132 {
32- return this . children . add ( StaticBitmapTextFactory ( this . state , x , y , font , text , size , align ) ) ;
33+ return this . displayList . add ( StaticBitmapTextFactory ( this . state , x , y , font , text , size , align ) ) ;
3334 } ,
3435
3536 dynamicBitmapText : function ( x , y , font , text , size , align )
3637 {
37- return this . children . add ( DynamicBitmapTextFactory ( this . state , x , y , font , text , size , align ) ) ;
38+ return this . displayList . add ( DynamicBitmapTextFactory ( this . state , x , y , font , text , size , align ) ) ;
3839 } ,
3940
4041 blitter : function ( x , y , key , frame )
4142 {
42- return this . children . add ( BlitterFactory ( this . state , x , y , key , frame ) ) ;
43+ return this . displayList . add ( BlitterFactory ( this . state , x , y , key , frame ) ) ;
4344 } ,
4445
4546 effectLayer : function ( x , y , width , height , effectName , fragmentShader )
4647 {
47- return this . children . add ( EffectLayerFactory ( this . state , x , y , width , height , effectName , fragmentShader ) ) ;
48+ return this . displayList . add ( EffectLayerFactory ( this . state , x , y , width , height , effectName , fragmentShader ) ) ;
4849 } ,
4950
5051 graphics : function ( config )
5152 {
52- return this . children . add ( GraphicsFactory ( this . state , config ) ) ;
53+ return this . displayList . add ( GraphicsFactory ( this . state , config ) ) ;
5354 } ,
5455
55- group : function ( children , config )
56+ group : function ( displayList , config )
5657 {
57- return GroupFactory ( this . state , children , config ) ;
58+ return GroupFactory ( this . state , displayList , config ) ;
5859 } ,
5960
6061 image : function ( x , y , key , frame )
6162 {
62- return this . children . add ( ImageFactory ( this . state , x , y , key , frame ) ) ;
63+ return this . displayList . add ( ImageFactory ( this . state , x , y , key , frame ) ) ;
6364 } ,
6465
6566 mesh : function ( x , y , vertices , uv , key , frame )
6667 {
67- return this . children . add ( MeshFactory ( this . state , x , y , vertices , uv , key , frame ) ) ;
68+ return this . displayList . add ( MeshFactory ( this . state , x , y , vertices , uv , key , frame ) ) ;
6869 } ,
6970
7071 quad : function ( x , y , key , frame )
7172 {
72- return this . children . add ( QuadFactory ( this . state , x , y , key , frame ) ) ;
73+ return this . displayList . add ( QuadFactory ( this . state , x , y , key , frame ) ) ;
7374 } ,
7475
7576 renderPass : function ( x , y , width , height , shaderName , fragmentShader )
7677 {
77- return this . children . add ( RenderPassFactory ( this . state , x , y , width , height , shaderName , fragmentShader ) ) ;
78+ return this . displayList . add ( RenderPassFactory ( this . state , x , y , width , height , shaderName , fragmentShader ) ) ;
7879 } ,
7980
8081 sprite : function ( x , y , key , frame )
8182 {
82- return this . children . add ( SpriteFactory ( this . state , x , y , key , frame ) ) ;
83+ var sprite = SpriteFactory ( this . state , x , y , key , frame ) ;
84+
85+ this . displayList . add ( sprite ) ;
86+ this . updateList . add ( sprite ) ;
87+
88+ return sprite ;
8389 } ,
8490
8591 text : function ( x , y , text , style )
8692 {
87- return this . children . add ( TextFactory ( this . state , x , y , text , style ) ) ;
93+ return this . displayList . add ( TextFactory ( this . state , x , y , text , style ) ) ;
8894 } ,
8995
9096 tilemap : function ( mapData , x , y , tileWidth , tileHeight , mapWidth , mapHeight , tileBorder , texture , frame )
9197 {
92- return this . children . add ( DynamicTilemapFactory ( this . state , mapData , x , y , tileWidth , tileHeight , mapWidth , mapHeight , tileBorder , texture , frame ) ) ;
98+ return this . displayList . add ( DynamicTilemapFactory ( this . state , mapData , x , y , tileWidth , tileHeight , mapWidth , mapHeight , tileBorder , texture , frame ) ) ;
9399 } ,
94100
95101 staticTilemap : function ( mapData , x , y , tileWidth , tileHeight , mapWidth , mapHeight , tileBorder , texture , frame )
96102 {
97- return this . children . add ( StaticTilemapFactory ( this . state , mapData , x , y , tileWidth , tileHeight , mapWidth , mapHeight , tileBorder , texture , frame ) ) ;
98- } ,
103+ return this . displayList . add ( StaticTilemapFactory ( this . state , mapData , x , y , tileWidth , tileHeight , mapWidth , mapHeight , tileBorder , texture , frame ) ) ;
104+ } ,
99105
100106 tileSprite : function ( x , y , width , height , key , frame )
101107 {
102- return this . children . add ( TileSpriteFactory ( this . state , x , y , width , height , key , frame ) ) ;
108+ return this . displayList . add ( TileSpriteFactory ( this . state , x , y , width , height , key , frame ) ) ;
103109 }
104110
105111} ) ;
0 commit comments