Beispiel #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Guarantees that the storage device will be not be null before continuing
            //while(Storage == null)
            //{
            // Console.Write("Getting Storage...");
            // To avoid GuideAlreadyVisibleException
            while (LiveServices.GuideIsVisible())
            {
            }
            StorageDevice.BeginShowSelector(getStorage, "Get initial StorageDevice");
            // Console.Write("   ..."+Storage+"... ");
            // Console.Write("Call Started...");
            //}

            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            GameTextures.load(Content);
            GameVideos.load(Content);
            PostProcessFx.LoadContent();
            //MapManager.tempMap.LoadContent(Content);
            font = Content.Load <SpriteFont>("FontA");
            //newfont = Content.Load<SpriteFont>("fontfile");
            newfont         = Content.Load <SpriteFont>("dotsfontfile");
            volterfont      = Content.Load <SpriteFont>("font-volter");
            newfontgreen    = Content.Load <SpriteFont>("fontfile-green");
            blueNumbersFont = Content.Load <SpriteFont>("bluenumbersfont");
            buttonsFont     = Content.Load <SpriteFont>("xboxControllerSpriteFont");
            ButtonDraw.initialize(buttonsFont);
            GC.Collect();
        }
Beispiel #2
0
        public static void Draw(GameTime gameTime)
        {
            BeatShift.graphics.GraphicsDevice.Viewport = Viewports.fullViewport;
            Rectangle viewArea = new Rectangle(0, 0, BeatShift.graphics.GraphicsDevice.Viewport.Width, BeatShift.graphics.GraphicsDevice.Viewport.Height);

            //Clear screen to black
            BeatShift.graphics.GraphicsDevice.Clear(Color.Black);
            if (Globals.PostProcess)
            {
                PostProcessFx.BeginDraw();                    //Set RenderTarget to bloom target instead of buffer
            }
            if (BeatShift.shipSelect.Visible && !(paused || LiveServices.GuideIsVisible()))
            {
                BeatShift.shipSelect.Draw(gameTime);
            }

            //Draw Main menu system if active, before drawing ship-selection ships
            if (MenuManager.mainMenuSystem.isActive)
            {
                MenuManager.Draw(gameTime);
            }

            //Begin 3D drawing region

            //Draw map
            if (Race.Visible)
            {
                Race.DrawMap(gameTime);
            }

            //Draw ships/racers and HUD
            if (Race.Visible)
            {
                Race.DrawShips(gameTime);
                Race.DrawHUD(gameTime);
            }

            //Begin glow pass
            if (Globals.PostProcess)
            {
                Race.DrawGlow(gameTime);
                //Race.DrawShips(gameTime);//Fake bit of geometry
                PostProcessFx.Draw(gameTime); //Apply bloom on 3D elements and draw to backbuffer.
            }


            //Draw any other menu systems (Pause/PostGame) which are active
            if (!MenuManager.mainMenuSystem.isActive)
            {
                MenuManager.Draw(gameTime);
            }



            //if (networkedGame.Visible) networkedGame.Draw(gameTime);
        }