MrGravity.ResetConfirm.Draw C# (CSharp) Méthode

Draw() public méthode

public Draw ( SpriteBatch spriteBatch, GraphicsDeviceManager graphics, Matrix scale ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
graphics GraphicsDeviceManager
scale Microsoft.Xna.Framework.Matrix
Résultat void
        public void Draw(SpriteBatch spriteBatch, GraphicsDeviceManager graphics, Matrix scale)
        {
            spriteBatch.Begin(SpriteSortMode.Immediate,
                BlendState.AlphaBlend,
                SamplerState.LinearClamp,
                DepthStencilState.None,
                RasterizerState.CullCounterClockwise,
                null,
                scale);

            Point center = graphics.GraphicsDevice.Viewport.TitleSafeArea.Center;
            Rectangle mScreenRect = graphics.GraphicsDevice.Viewport.TitleSafeArea;

            /* Draw the transparent background */
            spriteBatch.Draw(_mBackground, graphics.GraphicsDevice.Viewport.Bounds, Color.White);

            /* Draw the pause title */
            spriteBatch.Draw(_mTitle, new Vector2(center.X - _mTitle.Width / 2, mScreenRect.Top), Color.White);

            var currentLocation = new Vector2(mScreenRect.Left, mScreenRect.Top + _mTitle.Height);
            var height = mScreenRect.Height - _mTitle.Height;
            height -= (_mItems[0].Height + _mItems[1].Height);
            height /= 2;
            currentLocation.Y += height * 2;

            var request = "Are you sure you wish to reset your save file? \n" + "                   All save data will be lost!";

            Vector2 stringSize = _mQuartz.MeasureString(request);
            spriteBatch.DrawString(_mQuartz, request, new Vector2(mScreenRect.Center.X - stringSize.X / 2, mScreenRect.Center.Y), Color.White);
            spriteBatch.DrawString(_mQuartz, request, new Vector2(mScreenRect.Center.X - stringSize.X / 2 + 2, mScreenRect.Center.Y + 2), Color.CornflowerBlue);

            /* Draw the pause options */
            for (var i = 0; i < 2; i++)
            {
                spriteBatch.Draw(_mItems[i], new Rectangle(mScreenRect.Center.X - (_mItems[i].Width / 2), (int)currentLocation.Y, _mItems[i].Width, _mItems[i].Height), Color.White);
                currentLocation.Y += _mItems[i].Height;
            }

            spriteBatch.End();
        }