Danmaku_no_Kyojin.Screens.TitleScreen.Draw C# (CSharp) Method

Draw() public method

public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void
        public override void Draw(GameTime gameTime)
        {
            ControlManager.Draw(GameRef.SpriteBatch);

            GameRef.SpriteBatch.Begin();

            GameRef.SpriteBatch.Draw(_backgroundImage, _backgroundMainRectangle, Color.White);
            GameRef.SpriteBatch.Draw(_backgroundImage, _backgroundRightRectangle, Color.White);
            GameRef.SpriteBatch.Draw(_backgroundImage, _backgroundTopRectangle, Color.White);
            GameRef.SpriteBatch.Draw(_backgroundImage, _backgroundTopRightRectangle, Color.White);

            GameRef.SpriteBatch.Draw(_logo, new Vector2(
                                                (GameRef.Graphics.GraphicsDevice.Viewport.Width / 2) - (_logo.Width / 2),
                                                100), Color.White);

            for (int i = 0; i < _menuText.Length; i++)
            {
                Color textColor = Color.White;

                if (i == _menuIndex)
                    textColor = Color.OrangeRed;

                GameRef.SpriteBatch.DrawString(ControlManager.SpriteFont, _menuText[i], new Vector2(
                  Game.GraphicsDevice.Viewport.Width / 2f - (ControlManager.SpriteFont.MeasureString(_menuText[i]).X / 2f) + 1,
                  Game.GraphicsDevice.Viewport.Height / 2f + (50 * i) + 1), Color.Black);
                GameRef.SpriteBatch.DrawString(ControlManager.SpriteFont, _menuText[i], new Vector2(
                  Game.GraphicsDevice.Viewport.Width / 2f - (ControlManager.SpriteFont.MeasureString(_menuText[i]).X / 2f),
                  Game.GraphicsDevice.Viewport.Height / 2f + (50 * i)), textColor);
            }

            GameRef.SpriteBatch.DrawString(ControlManager.SpriteFont, "[" + _menuDescription[_menuIndex] + "]", new Vector2(
                Game.GraphicsDevice.Viewport.Width / 2f - (ControlManager.SpriteFont.MeasureString(_menuDescription[_menuIndex]).X / 2f) - 4 + 1,
                Game.GraphicsDevice.Viewport.Height - 60 + 1), Color.Black);
            GameRef.SpriteBatch.DrawString(ControlManager.SpriteFont, "[" + _menuDescription[_menuIndex] + "]", new Vector2(
                Game.GraphicsDevice.Viewport.Width / 2f - (ControlManager.SpriteFont.MeasureString(_menuDescription[_menuIndex]).X / 2f) - 4,
                Game.GraphicsDevice.Viewport.Height - 60), Color.White);

            string credits = "Credits: " + PlayerData.Credits.ToString(CultureInfo.InvariantCulture);

            GameRef.SpriteBatch.DrawString(ControlManager.SpriteFont, credits, new Vector2(1, Game.GraphicsDevice.Viewport.Height - ControlManager.SpriteFont.MeasureString(credits).Y + 1), Color.Black);
            GameRef.SpriteBatch.DrawString(ControlManager.SpriteFont, credits, new Vector2(0, Game.GraphicsDevice.Viewport.Height - ControlManager.SpriteFont.MeasureString(credits).Y), Color.White);

            GameRef.SpriteBatch.End();

            base.Draw(gameTime);
        }