@@ -3,6 +3,7 @@ var Bob = require('./Bob');
33var Class = require ( '../../utils/Class' ) ;
44var Components = require ( '../components' ) ;
55var DisplayList = require ( '../DisplayList' ) ;
6+ var Frame = require ( '../../textures/Frame' ) ;
67var GameObject = require ( '../GameObject' ) ;
78
89/**
@@ -41,14 +42,15 @@ var Blitter = new Class({
4142 this . setTexture ( texture , frame ) ;
4243 this . setPosition ( x , y ) ;
4344
44- this . children = new DisplayList ( this ) ;
45+ this . children = new DisplayList ( ) ;
4546
4647 this . renderList = [ ] ;
4748
4849 this . dirty = false ;
4950 } ,
5051
5152 // frame MUST be part of the Blitter texture
53+ // and can be either a Frame object or a string
5254 create : function ( x , y , frame , visible , index )
5355 {
5456 if ( visible === undefined ) { visible = true ; }
@@ -58,7 +60,7 @@ var Blitter = new Class({
5860 {
5961 frame = this . frame ;
6062 }
61- else
63+ else if ( ! ( frame instanceof Frame ) )
6264 {
6365 frame = this . texture . get ( frame ) ;
6466 }
@@ -90,7 +92,7 @@ var Blitter = new Class({
9092 // frame MUST be part of the Blitter texture
9193 createMultiple : function ( quantity , frame , visible )
9294 {
93- if ( frame === undefined ) { frame = this . frame ; }
95+ if ( frame === undefined ) { frame = this . frame . name ; }
9496 if ( visible === undefined ) { visible = true ; }
9597
9698 if ( ! Array . isArray ( frame ) )
0 commit comments