コード例 #1
0
        public override void AddToManagers()
        {
            MapScreenGum.InstanceInitialize(); FlatRedBall.FlatRedBallServices.GraphicsOptions.SizeOrOrientationChanged += MapScreenGum.HandleResolutionChanged;
            FlatRedBall.SpriteManager.AddLayer(StructureLayer);
            StructureLayer.UsePixelCoordinates();
            if (FlatRedBall.SpriteManager.Camera.Orthogonal)
            {
                StructureLayer.LayerCameraSettings.OrthogonalWidth  = FlatRedBall.SpriteManager.Camera.OrthogonalWidth;
                StructureLayer.LayerCameraSettings.OrthogonalHeight = FlatRedBall.SpriteManager.Camera.OrthogonalHeight;
            }
            FlatRedBall.SpriteManager.AddLayer(HUDLayer);
            HUDLayer.UsePixelCoordinates();
            if (FlatRedBall.SpriteManager.Camera.Orthogonal)
            {
                HUDLayer.LayerCameraSettings.OrthogonalWidth  = FlatRedBall.SpriteManager.Camera.OrthogonalWidth;
                HUDLayer.LayerCameraSettings.OrthogonalHeight = FlatRedBall.SpriteManager.Camera.OrthogonalHeight;
            }
            StructureLayerGum      = RenderingLibrary.SystemManagers.Default.Renderer.AddLayer();
            StructureLayerGum.Name = "StructureLayerGum";
            MapScreenGum.AddGumLayerToFrbLayer(StructureLayerGum, StructureLayer);
            HUDLayerGum      = RenderingLibrary.SystemManagers.Default.Renderer.AddLayer();
            HUDLayerGum.Name = "HUDLayerGum";
            MapScreenGum.AddGumLayerToFrbLayer(HUDLayerGum, HUDLayer);
            Factories.BombardingTowerFactory.AddList(StructureList);
            Factories.ChemicalTowerFactory.AddList(StructureList);
            Factories.ElectricTowerFactory.AddList(StructureList);
            Factories.FireTowerFactory.AddList(StructureList);
            Factories.FrostTowerFactory.AddList(StructureList);
            Factories.PiercingTowerFactory.AddList(StructureList);
            Factories.CannonProjectileFactory.AddList(ProjectileList);
            Factories.ChemicalProjectileFactory.AddList(ProjectileList);
            Factories.ElectricProjectileFactory.AddList(ProjectileList);
            Factories.FireProjectileFactory.AddList(ProjectileList);
            Factories.FrostProjectileFactory.AddList(ProjectileList);
            Factories.PiercingProjectileFactory.AddList(ProjectileList);
            MenuWindowInstance.AddToManagers(RenderingLibrary.SystemManagers.Default, System.Linq.Enumerable.FirstOrDefault(FlatRedBall.Gum.GumIdb.AllGumLayersOnFrbLayer(HUDLayer)));

            ChatHistoryInstance.AddToManagers(RenderingLibrary.SystemManagers.Default, System.Linq.Enumerable.FirstOrDefault(FlatRedBall.Gum.GumIdb.AllGumLayersOnFrbLayer(HUDLayer)));

            OkMessageInstance.AddToManagers(RenderingLibrary.SystemManagers.Default, System.Linq.Enumerable.FirstOrDefault(FlatRedBall.Gum.GumIdb.AllGumLayersOnFrbLayer(HUDLayer)));

            ConfirmationWindowInstance.AddToManagers(RenderingLibrary.SystemManagers.Default, System.Linq.Enumerable.FirstOrDefault(FlatRedBall.Gum.GumIdb.AllGumLayersOnFrbLayer(HUDLayer)));

            base.AddToManagers();
            AddToManagersBottomUp();
            CustomInitialize();
        }
コード例 #2
0
        public RenderableLayer(string contentManagerName, string thisName)
        {
            mContentManagerName = contentManagerName;
            mName = thisName;

            mRenderer = new RenderTargetRenderer(Camera.Main.DestinationRectangle.Width,
                                                 Camera.Main.DestinationRectangle.Height);

            TargetLayer = new Layer();
            TargetLayer.UsePixelCoordinates();

            mSprite = new Sprite();
            mSprite.TextureScale = 1;
            SpriteManager.AddToLayer(mSprite, TargetLayer);
            mSprite.AttachTo(Camera.Main, false);
            mSprite.RelativeX = 0;
            mSprite.RelativeY = 0;
            mSprite.RelativeZ = -40;
        }