Пример #1
0
        public StarlingGameSpriteWithTankTextures(SpriteToTexture64Constructor new_tex_crop)
        {
            tracks0 = new_tex_crop(new tracks0(), innersize: 128, alpha: 0.1);

            tanktrackpattern   = new_tex_crop(new tanktrackpattern(), innersize: 128);
            greentank_guntower = new_tex_crop(new greentank_guntower(), innersize: 128);
            greentank_shadow   = new_tex_crop(new greentank_shadow(), innersize: 128, alpha: 0.3);

            greentank = new_tex_crop(new greentank(), innersize: 128);
        }
        public StarlingGameSpriteWithPedTextures(
            Texture64Constructor new_tex_crop,
            SpriteToTexture64Constructor new_texsprite_crop
            )
        {
            //DRW 3

            hud_look             = new_texsprite_crop(new hud_look(), innersize: 128);
            hud_look_building    = new_texsprite_crop(new hud_look_building(), innersize: 128);
            hud_look_goggles     = new_texsprite_crop(new hud_look_goggles(), innersize: 128);
            hud_look_onlygoggles = new_texsprite_crop(new hud_look_onlygoggles(), innersize: 128);

            ped_shadow = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_shadow.svg", alpha: 0.3, innersize: 96);

            ped_footprints = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_footprints.svg", 0.07);


            var r = 0.2225;
            var g = 0.7169;
            var b = 0.0606;

            // http://blog.slapthink.net/2008/12/24/desaturategreyscale-a-movieclip-in-as3/
            var ped_walkzombie_filter = new ScriptCoreLib.ActionScript.flash.filters.ColorMatrixFilter(

                r, g, b, 0, 0,
                r, g, b, 0, 0,
                r, g, b, 0, 0,
                0, 0, 0, 1, 0
                );



            ped_walkzombie = new WalkFrames
            {
                ped_down = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_down.svg", innersize: 128, filter: ped_walkzombie_filter),

                ped_stand         = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_stand.svg", innersize: 128, filter: ped_walkzombie_filter),
                ped_gunstand      = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_gunstand.svg", innersize: 128, filter: ped_walkzombie_filter),
                ped_gunstand_fire = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_gunstand_fire.svg", innersize: 128),

                // left foot
                ped_walk1_leftfar   = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_stand_walk1.svg", innersize: 128, filter: ped_walkzombie_filter),
                ped_walk2_leftmid   = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_stand_walk2.svg", innersize: 128, filter: ped_walkzombie_filter),
                ped_walk3_leftclose = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_stand_walk3.svg", innersize: 128, filter: ped_walkzombie_filter),

                ped_walk1x_rightfar   = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_stand_walk1.svg", flipx: true, innersize: 128, filter: ped_walkzombie_filter),
                ped_walk2x_rightmid   = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_stand_walk2.svg", flipx: true, innersize: 128, filter: ped_walkzombie_filter),
                ped_walk3x_rightclose = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_stand_walk3.svg", flipx: true, innersize: 128, filter: ped_walkzombie_filter)
            };

            ped_walk = new WalkFrames
            {
                ped_down = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_down.svg", innersize: 128),

                ped_stand         = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_normalstand.svg", innersize: 128),
                ped_gunstand      = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_gunstand.svg", innersize: 128),
                ped_gunstand_fire = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_gunstand_fire.svg", innersize: 128),

                // left foot
                ped_walk1_leftfar   = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_normalstand_walk1.svg", innersize: 128),
                ped_walk2_leftmid   = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_normalstand_walk2.svg", innersize: 128),
                ped_walk3_leftclose = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_normalstand_walk3.svg", innersize: 128),

                ped_walk1x_rightfar   = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_normalstand_walk1.svg", flipx: true, innersize: 128),
                ped_walk2x_rightmid   = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_normalstand_walk2.svg", flipx: true, innersize: 128),
                ped_walk3x_rightclose = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_normalstand_walk3.svg", flipx: true, innersize: 128)
            };
        }
        public StarlingGameSpriteWithPedTextures(
            Texture64Constructor new_tex_crop,
            SpriteToTexture64Constructor new_texsprite_crop
            )
        {
            //DRW 3

            hud_look = new_texsprite_crop(new hud_look(), innersize: 128);
            hud_look_building = new_texsprite_crop(new hud_look_building(), innersize: 128);
            hud_look_goggles = new_texsprite_crop(new hud_look_goggles(), innersize: 128);
            hud_look_onlygoggles = new_texsprite_crop(new hud_look_onlygoggles(), innersize: 128);

            ped_shadow = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_shadow.svg", alpha: 0.3, innersize: 96);

            ped_footprints = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_footprints.svg", 0.07);


            var r = 0.2225;
            var g = 0.7169;
            var b = 0.0606;

            // http://blog.slapthink.net/2008/12/24/desaturategreyscale-a-movieclip-in-as3/
            var ped_walkzombie_filter = new ScriptCoreLib.ActionScript.flash.filters.ColorMatrixFilter(

                r, g, b, 0, 0,
                r, g, b, 0, 0,
                r, g, b, 0, 0,
                0, 0, 0, 1, 0
            );




            ped_walkzombie = new WalkFrames
            {
                ped_down = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_down.svg", innersize: 128, filter: ped_walkzombie_filter),

                ped_stand = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_stand.svg", innersize: 128, filter: ped_walkzombie_filter),
                ped_gunstand = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_gunstand.svg", innersize: 128, filter: ped_walkzombie_filter),
                ped_gunstand_fire = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_gunstand_fire.svg", innersize: 128),

                // left foot
                ped_walk1_leftfar = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_stand_walk1.svg", innersize: 128, filter: ped_walkzombie_filter),
                ped_walk2_leftmid = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_stand_walk2.svg", innersize: 128, filter: ped_walkzombie_filter),
                ped_walk3_leftclose = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_stand_walk3.svg", innersize: 128, filter: ped_walkzombie_filter),

                ped_walk1x_rightfar = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_stand_walk1.svg", flipx: true, innersize: 128, filter: ped_walkzombie_filter),
                ped_walk2x_rightmid = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_stand_walk2.svg", flipx: true, innersize: 128, filter: ped_walkzombie_filter),
                ped_walk3x_rightclose = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_stand_walk3.svg", flipx: true, innersize: 128, filter: ped_walkzombie_filter)
            };

            ped_walk = new WalkFrames
            {
                ped_down = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_down.svg", innersize: 128),

                ped_stand = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_normalstand.svg", innersize: 128),
                ped_gunstand = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_gunstand.svg", innersize: 128),
                ped_gunstand_fire = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_gunstand_fire.svg", innersize: 128),

                // left foot
                ped_walk1_leftfar = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_normalstand_walk1.svg", innersize: 128),
                ped_walk2_leftmid = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_normalstand_walk2.svg", innersize: 128),
                ped_walk3_leftclose = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_normalstand_walk3.svg", innersize: 128),

                ped_walk1x_rightfar = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_normalstand_walk1.svg", flipx: true, innersize: 128),
                ped_walk2x_rightmid = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_normalstand_walk2.svg", flipx: true, innersize: 128),
                ped_walk3x_rightclose = new_tex_crop("assets/FlashHeatZeeker.UnitPed/ped_normalstand_walk3.svg", flipx: true, innersize: 128)
            };
        }
        public StarlingGameSpriteBase()
        {
            instance = this;

            gametime.Start();

            this.Content = new Sprite().AttachTo(this);

            this.Content_layer0_ground = new Sprite().AttachTo(this.Content);
            this.Content_layer0_tracks = new Sprite().AttachTo(this.Content);
            this.Content_layer2_shadows = new Sprite().AttachTo(this.Content);
            this.Content_layer3_buildings = new Sprite().AttachTo(this.Content);

            this.Content_layer10_hiddenforgoggles = new Sprite().AttachTo(this.Content);
            this.Content_layer10_hiddenforgoggles.visible = false;

            this.info = new TextField(
                800,
                400,
                "Welcome to Starling!"
                ) { hAlign = HAlign.LEFT, vAlign = VAlign.TOP };


			// i can see text, cannot see images?
			info.AttachTo(this);
            //info.MoveTo(72, 8);





			this.stagescale = internalscale;

            onresize(
                (w, h) =>
                {
                    stagex = w * 0.5;
                    stagey = h * 0.8;
                    stagescale = internalscale * (w) / (800.0);


                }
            );



            #region Source0
            var SourceBitmapData0 = new ScriptCoreLib.ActionScript.flash.display.BitmapData(
                // 28MB
                //64 * 2,
                //64 * 2,

                 // 50 MB
                 2048,
                 2048,
                 true, 0x00000000
            );
            var Source0TextureCount = 0;
            // where to start?
            var Source0TextureTop = 0;
            var Source0TextureLeft = 0;

            // fighting mipmapping
            var Source0Padding = 4;

			// ?
            var Source0 = new XLazy<TextureAtlas>(
                 delegate
                 {
                     var SourceTexture = Texture.fromBitmapData(SourceBitmapData0);
                     var Source = new TextureAtlas(SourceTexture);


                     return Source;
                 }
              );
            #endregion



            #region new_tex_crop
            this.new_tex_crop =
               (asset, alpha, flipx, innersize, adjustAlpha, filter) =>
               {

                   var shape = ScriptCoreLib.ActionScript.Extensions.KnownEmbeddedResources.Default[asset].ToSprite();

                   return new_texsprite_crop(shape, alpha, flipx, innersize, adjustAlpha, filter);
               };


            this.new_texsprite_crop =
               (shape, alpha, flipx, innersize, adjustAlpha, filter) =>
               {


                   //var innersize = 64;
                   // outer 400, inner 64

                   // do we need to wrap?
                   if ((Source0TextureLeft + innersize) >= 2048)
                   {
                       // if so, goto next line
                       Source0TextureTop = Source0TextureMaxBottom;
                       Source0TextureLeft = 0;
                   }

                   var rect = new Rectangle(Source0TextureLeft, Source0TextureTop, innersize, innersize);

                   {

                       if (filter != null)
                           shape.filters = new[] { filter };

                       // this does not work!
                       //shape.alpha = 0.3;



                       // next image will appear right to us + padding to prevent bleed
                       Source0TextureLeft += innersize + Source0Padding;
                       Source0TextureMaxBottom = Source0TextureMaxBottom.Max(Source0TextureTop + innersize + Source0Padding);

                       var m = new Matrix();

                       // flip vertical?
                       if (flipx)
                       {
                           m.translate(-400, 0);
                           m.scale(-1, 1);
                       }

                       m.translate(
                           // where to draw? we need packer algorithm?
                           -(400 - rect.width) / 2 + rect.left,
                           -(400 - rect.height) / 2 + rect.top
                      );



                       // http://stackoverflow.com/questions/8035717/actionscript-3-draw-with-transparency-on-a-bitmap

                       if (adjustAlpha == null)
                           adjustAlpha = new ColorTransform();

                       adjustAlpha.alphaMultiplier = alpha;


                       // public void draw(IBitmapDrawable source, Matrix matrix, ColorTransform colorTransform, string blendMode, Rectangle clipRect);
                       //SourceBitmapData0.draw(shape, m, adjustAlpha, clipRect: rect);
                       SourceBitmapData0.draw(shape, m, adjustAlpha, null, rect);
                   }

                   var TextureIndex = Source0TextureCount;

                   Source0TextureCount++;

                   // Error	5	Cannot convert anonymous method to type 'FlashHeatZeeker.UnitPed.Library.Lazy<starling.textures.TextureAtlas>' because it is not a delegate type	X:\jsc.svn\examples\actionscript\svg\FlashHeatZeeker\FlashHeatZeeker.UnitPed\Library\StarlingGameSpriteWithPed.cs	178	43	FlashHeatZeeker.UnitPed
                   var y = new XLazy<TextureAtlas>(
                       delegate
                       {
                           Source0.Content.addRegion(TextureIndex.ToString(), rect);

                           return Source0.Content;
                       }
                    );


                   // ???
                   return () => y.Content.getTexture(TextureIndex.ToString());
               };
            #endregion


            #region new_tex96
            this.new_tex96 =
               (shape, innersize) =>
               {

                   // outer 400, inner 64

                   // do we need to wrap?
                   if ((Source0TextureLeft + innersize) >= 2048)
                   {
                       // if so, goto next line
                       Source0TextureTop = Source0TextureMaxBottom;
                       Source0TextureLeft = 0;
                   }

                   var rect = new Rectangle(Source0TextureLeft, Source0TextureTop, innersize, innersize);

                   {

                       // this does not work!
                       //shape.alpha = 0.3;



                       // next image will appear right to us
                       Source0TextureLeft += innersize + Source0Padding;
                       Source0TextureMaxBottom = Source0TextureMaxBottom.Max(Source0TextureTop + innersize + Source0Padding);

                       var m = new Matrix();
                       m.translate(
                           // where to draw? we need packer algorithm?
                           rect.left,
                           rect.top
                      );

                       //m.scale(64 / 400.0, 64 / 400.0);

                       // http://stackoverflow.com/questions/8035717/actionscript-3-draw-with-transparency-on-a-bitmap

                       var adjustAlpha = new ColorTransform();
                       adjustAlpha.alphaMultiplier = alpha;


                       SourceBitmapData0.draw(shape, m, adjustAlpha);
                   }

                   var TextureIndex = Source0TextureCount;

                   Source0TextureCount++;

                   // Error	5	Cannot convert anonymous method to type 'FlashHeatZeeker.UnitPed.Library.Lazy<starling.textures.TextureAtlas>' because it is not a delegate type	X:\jsc.svn\examples\actionscript\svg\FlashHeatZeeker\FlashHeatZeeker.UnitPed\Library\StarlingGameSpriteWithPed.cs	178	43	FlashHeatZeeker.UnitPed
                   var y = new XLazy<TextureAtlas>(
                       delegate
                       {
                           Source0.Content.addRegion(TextureIndex.ToString(), rect);

                           return Source0.Content;
                       }
                    );

                   return () => y.Content.getTexture(TextureIndex.ToString());
               };
            #endregion


            //var __bmd = new ScriptCoreLib.ActionScript.flash.display.BitmapData(96, 96, true, 0x00000000);
            //__bmd.draw(new white_jsc());
            var LogoTexture = new_tex96(new white_jsc());

            onbeforefirstframe += delegate
            {
                //var count = 64;
                var count = DefaultLogoCount;

                for (int i = 0; i < count; i++)
                    for (int yi = 0; yi < count; yi++)
                    {
                        var logo = new Image(LogoTexture()) { }.AttachTo(Content);

                        {
                            var cm = new Matrix();
                            cm.rotate(random.NextDouble() * Math.PI);
                            cm.translate(i * 96, yi * 96);

                            logo.transformationMatrix = cm;
                        }
                    }
            };


            // http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display3D/Context3D.html#driverInfo
            //Text = Starling.current.context.driverInfo;
            Text = "driverInfo missing";


            // how expensive is delegate call in a frame?
            onframe +=
                (stage, starling) =>
                {
                    if (this.frameid == 0)
                    {
                        if (this.onbeforefirstframe != null)
                            this.onbeforefirstframe(stage, starling);
                    }

                    this.frameid++;


                    if (!this.DisableDefaultContentDransformation)
                    {
                        var cm = new Matrix();
                        cm.scale(stagescale, stagescale);

                        if (autorotate)
                            cm.rotate(this.gametime.ElapsedMilliseconds * 0.001);

                        cm.translate(stagex, stagey);
                        this.Content.transformationMatrix = cm;
                    }


                    // does this cost us 40FPS??
                    //var texmem = (this.Source0TextureMaxBottom * 100 / 2048) + "%";

                    //this.info.text = new { this.frameid, texmem, this.Text }.ToString();

                };
        }
        public StarlingGameSpriteBase()
        {
            instance = this;

            gametime.Start();

            this.Content = new Sprite().AttachTo(this);

            this.Content_layer0_ground    = new Sprite().AttachTo(this.Content);
            this.Content_layer0_tracks    = new Sprite().AttachTo(this.Content);
            this.Content_layer2_shadows   = new Sprite().AttachTo(this.Content);
            this.Content_layer3_buildings = new Sprite().AttachTo(this.Content);

            this.Content_layer10_hiddenforgoggles         = new Sprite().AttachTo(this.Content);
            this.Content_layer10_hiddenforgoggles.visible = false;

            this.info = new TextField(
                800,
                400,
                "Welcome to Starling!"
                )
            {
                hAlign = HAlign.LEFT, vAlign = VAlign.TOP
            };


            // i can see text, cannot see images?
            info.AttachTo(this);
            //info.MoveTo(72, 8);



            this.stagescale = internalscale;

            onresize(
                (w, h) =>
            {
                stagex     = w * 0.5;
                stagey     = h * 0.8;
                stagescale = internalscale * (w) / (800.0);
            }
                );



            #region Source0
            var SourceBitmapData0 = new ScriptCoreLib.ActionScript.flash.display.BitmapData(
                // 28MB
                //64 * 2,
                //64 * 2,

                // 50 MB
                2048,
                2048,
                true, 0x00000000
                );
            var Source0TextureCount = 0;
            // where to start?
            var Source0TextureTop  = 0;
            var Source0TextureLeft = 0;

            // fighting mipmapping
            var Source0Padding = 4;

            // ?
            var Source0 = new XLazy <TextureAtlas>(
                delegate
            {
                var SourceTexture = Texture.fromBitmapData(SourceBitmapData0);
                var Source        = new TextureAtlas(SourceTexture);


                return(Source);
            }
                );
            #endregion



            #region new_tex_crop
            this.new_tex_crop =
                (asset, alpha, flipx, innersize, adjustAlpha, filter) =>
            {
                var shape = ScriptCoreLib.ActionScript.Extensions.KnownEmbeddedResources.Default[asset].ToSprite();

                return(new_texsprite_crop(shape, alpha, flipx, innersize, adjustAlpha, filter));
            };


            this.new_texsprite_crop =
                (shape, alpha, flipx, innersize, adjustAlpha, filter) =>
            {
                //var innersize = 64;
                // outer 400, inner 64

                // do we need to wrap?
                if ((Source0TextureLeft + innersize) >= 2048)
                {
                    // if so, goto next line
                    Source0TextureTop  = Source0TextureMaxBottom;
                    Source0TextureLeft = 0;
                }

                var rect = new Rectangle(Source0TextureLeft, Source0TextureTop, innersize, innersize);

                {
                    if (filter != null)
                    {
                        shape.filters = new[] { filter }
                    }
                    ;

                    // this does not work!
                    //shape.alpha = 0.3;



                    // next image will appear right to us + padding to prevent bleed
                    Source0TextureLeft     += innersize + Source0Padding;
                    Source0TextureMaxBottom = Source0TextureMaxBottom.Max(Source0TextureTop + innersize + Source0Padding);

                    var m = new Matrix();

                    // flip vertical?
                    if (flipx)
                    {
                        m.translate(-400, 0);
                        m.scale(-1, 1);
                    }

                    m.translate(
                        // where to draw? we need packer algorithm?
                        -(400 - rect.width) / 2 + rect.left,
                        -(400 - rect.height) / 2 + rect.top
                        );



                    // http://stackoverflow.com/questions/8035717/actionscript-3-draw-with-transparency-on-a-bitmap

                    if (adjustAlpha == null)
                    {
                        adjustAlpha = new ColorTransform();
                    }

                    adjustAlpha.alphaMultiplier = alpha;


                    // public void draw(IBitmapDrawable source, Matrix matrix, ColorTransform colorTransform, string blendMode, Rectangle clipRect);
                    //SourceBitmapData0.draw(shape, m, adjustAlpha, clipRect: rect);
                    SourceBitmapData0.draw(shape, m, adjustAlpha, null, rect);
                }

                var TextureIndex = Source0TextureCount;

                Source0TextureCount++;

                // Error	5	Cannot convert anonymous method to type 'FlashHeatZeeker.UnitPed.Library.Lazy<starling.textures.TextureAtlas>' because it is not a delegate type	X:\jsc.svn\examples\actionscript\svg\FlashHeatZeeker\FlashHeatZeeker.UnitPed\Library\StarlingGameSpriteWithPed.cs	178	43	FlashHeatZeeker.UnitPed
                var y = new XLazy <TextureAtlas>(
                    delegate
                {
                    Source0.Content.addRegion(TextureIndex.ToString(), rect);

                    return(Source0.Content);
                }
                    );


                // ???
                return(() => y.Content.getTexture(TextureIndex.ToString()));
            };
            #endregion


            #region new_tex96
            this.new_tex96 =
                (shape, innersize) =>
            {
                // outer 400, inner 64

                // do we need to wrap?
                if ((Source0TextureLeft + innersize) >= 2048)
                {
                    // if so, goto next line
                    Source0TextureTop  = Source0TextureMaxBottom;
                    Source0TextureLeft = 0;
                }

                var rect = new Rectangle(Source0TextureLeft, Source0TextureTop, innersize, innersize);

                {
                    // this does not work!
                    //shape.alpha = 0.3;



                    // next image will appear right to us
                    Source0TextureLeft     += innersize + Source0Padding;
                    Source0TextureMaxBottom = Source0TextureMaxBottom.Max(Source0TextureTop + innersize + Source0Padding);

                    var m = new Matrix();
                    m.translate(
                        // where to draw? we need packer algorithm?
                        rect.left,
                        rect.top
                        );

                    //m.scale(64 / 400.0, 64 / 400.0);

                    // http://stackoverflow.com/questions/8035717/actionscript-3-draw-with-transparency-on-a-bitmap

                    var adjustAlpha = new ColorTransform();
                    adjustAlpha.alphaMultiplier = alpha;


                    SourceBitmapData0.draw(shape, m, adjustAlpha);
                }

                var TextureIndex = Source0TextureCount;

                Source0TextureCount++;

                // Error	5	Cannot convert anonymous method to type 'FlashHeatZeeker.UnitPed.Library.Lazy<starling.textures.TextureAtlas>' because it is not a delegate type	X:\jsc.svn\examples\actionscript\svg\FlashHeatZeeker\FlashHeatZeeker.UnitPed\Library\StarlingGameSpriteWithPed.cs	178	43	FlashHeatZeeker.UnitPed
                var y = new XLazy <TextureAtlas>(
                    delegate
                {
                    Source0.Content.addRegion(TextureIndex.ToString(), rect);

                    return(Source0.Content);
                }
                    );

                return(() => y.Content.getTexture(TextureIndex.ToString()));
            };
            #endregion


            //var __bmd = new ScriptCoreLib.ActionScript.flash.display.BitmapData(96, 96, true, 0x00000000);
            //__bmd.draw(new white_jsc());
            var LogoTexture = new_tex96(new white_jsc());

            onbeforefirstframe += delegate
            {
                //var count = 64;
                var count = DefaultLogoCount;

                for (int i = 0; i < count; i++)
                {
                    for (int yi = 0; yi < count; yi++)
                    {
                        var logo = new Image(LogoTexture())
                        {
                        }.AttachTo(Content);

                        {
                            var cm = new Matrix();
                            cm.rotate(random.NextDouble() * Math.PI);
                            cm.translate(i * 96, yi * 96);

                            logo.transformationMatrix = cm;
                        }
                    }
                }
            };


            // http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display3D/Context3D.html#driverInfo
            //Text = Starling.current.context.driverInfo;
            Text = "driverInfo missing";


            // how expensive is delegate call in a frame?
            onframe +=
                (stage, starling) =>
            {
                if (this.frameid == 0)
                {
                    if (this.onbeforefirstframe != null)
                    {
                        this.onbeforefirstframe(stage, starling);
                    }
                }

                this.frameid++;


                if (!this.DisableDefaultContentDransformation)
                {
                    var cm = new Matrix();
                    cm.scale(stagescale, stagescale);

                    if (autorotate)
                    {
                        cm.rotate(this.gametime.ElapsedMilliseconds * 0.001);
                    }

                    cm.translate(stagex, stagey);
                    this.Content.transformationMatrix = cm;
                }


                // does this cost us 40FPS??
                //var texmem = (this.Source0TextureMaxBottom * 100 / 2048) + "%";

                //this.info.text = new { this.frameid, texmem, this.Text }.ToString();
            };
        }