Beispiel #1
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            this.DisplayInGame();
            FMODUtil.System.update();

            //Used to render things to a buffer that will have a zoom multiplier applied before rendering.
            SpriteBatch    zoomBatch = new SpriteBatch(this.GraphicsDevice);
            RenderTarget2D target    = new RenderTarget2D(this.GraphicsDevice, RenderingPipe.FullScreenWindow.Width, RenderingPipe.FullScreenWindow.Height);

            this.GraphicsDevice.SetRenderTarget(target);

            this.GraphicsDevice.Clear(Color.Black);



            if (Game1.SplashDone)
            {
                zoomBatch.Begin();
                RenderingPipe.DrawScreen(zoomBatch);
                zoomBatch.End();
            }
            else
            {
                int length = Game1.SplashScreens.Count;
                for (int i = 0; i < length; i++)
                {
                    LogoScreen item = Game1.SplashScreens[i];
                    if (!item.Done())
                    {
                        item.Draw(ref zoomBatch);
                        break;
                    }

                    if (i == length - 1)
                    {
                        Game1.SplashDone = true;

                        //Initialize main menu
                        GUI.MainMenu.MainMenu.Initialize();
                        this.IsMouseVisible = true;
                    }
                }
            }

            //set rendering back to the back buffer
            this.GraphicsDevice.SetRenderTarget(null);

            //render target to back buffer
            zoomBatch.Begin();

            int width  = (int)(this.GraphicsDevice.DisplayMode.Width * RenderingPipe.Zoom);
            int height = (int)(this.GraphicsDevice.DisplayMode.Height * RenderingPipe.Zoom);

            zoomBatch.Draw(target, new Rectangle(0, 0, width, height), Color.White);
            RenderingPipe.DrawGUI(zoomBatch);
            zoomBatch.End();

            base.Draw(gameTime);
        }
Beispiel #2
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            float deltaTime = (float)gameTime.ElapsedGameTime.TotalSeconds;

            this.DisplayInGame();
            FMODUtil.Update();

            //Used to render things to a buffer that will have a zoom multiplier applied before rendering.
            this.GraphicsDevice.Clear(Color.Black);

            if (Game1.SplashDone)
            {
                if (World.Dimensions.Count > 0)
                {
                    //Never set this to SpriteSortMode.Texture, as that causes bugs.
                    this.MapSpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend,
                                              null, null, null, null, RenderInfo.Camera2D.TranslationMatrix);

                    RenderingPipe.DrawScreen(this.MapSpriteBatch);
                    this.MapSpriteBatch.End();
                }

                this.GUIBatch.Begin();
                RenderingPipe.DrawGUI(this.GUIBatch);
                this.GUIBatch.End();
            }
            else
            {
                int length = Game1.SplashScreens.Count;
                for (int i = 0; i < length; i++)
                {
                    LogoScreen item = Game1.SplashScreens[i];
                    if (!item.Done())
                    {
                        item.Draw(this.MapSpriteBatch);
                        break;
                    }

                    if (i == length - 1)
                    {
                        Game1.SplashDone = true;

                        //Initialize main menu
                        GUI.MainMenu.MainMenu.Initialize();
                        this.IsMouseVisible = true;
                    }
                }
            }
            base.Draw(gameTime);
        }
Beispiel #3
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            FMODUtil.System.update();
            this.GraphicsDevice.SetRenderTarget(null);
            this.GraphicsDevice.Clear(Color.Black);

            if (Game1.SplashDone)
            {
                this.SpriteBatch.Begin();
                RenderingPipe.DrawScreen(ref this.SpriteBatch);
                this.SpriteBatch.End();
            }
            else
            {
                int length = Game1.SplashScreens.Count;
                for (int i = 0; i < length; i++)
                {
                    LogoScreen item = Game1.SplashScreens[i];
                    if (!item.Done())
                    {
                        item.Draw(ref this.SpriteBatch);
                        break;
                    }

                    if (i == length - 1)
                    {
                        Game1.SplashDone = true;

                        //Initialize main menu
                        GUI.MainMenu.MainMenu.Initialize();
                        this.IsMouseVisible = true;
                    }
                }
            }

            base.Draw(gameTime);
        }