private void DrawTopScreenRecursive()
        {
            if (_screens.Count == 0)
            {
                return;
            }

            var screen = _screens.Pop();

            if (screen.SeeThroughType != SeeThrough.None)
            {
                DrawTopScreenRecursive();
            }
            else
            {
                GraphicsDevice.Clear(screen.BackgroundColor);
            }

            if (screen.SeeThroughType == SeeThrough.Partial)
            {
                var pixel = TextureManager.Get(Texture.Pixel);
                _spriteBatch.Begin(blendState: BlendState.Additive);
                _spriteBatch.Draw(pixel, new Rectangle(0, 0, _graphics.PreferredBackBufferWidth, _graphics.PreferredBackBufferHeight), screen.BackgroundColor);
                _spriteBatch.End();
            }

            _screens.Push(screen);
            screen.Draw(_spriteBatch, _graphics);
        }
Beispiel #2
0
 private void DrawCircle(SpriteBatch spriteBatch, Core.Utility.Vector2 position, double radius, Color color)
 {
     spriteBatch.Draw(TextureManager.Get(Texture.Circle), new Rectangle((int)(position.X - radius), (int)(position.Y - radius), (int)(radius * 2), (int)(radius * 2)), color);
 }