public int Draw(SpriteBatch spriteBatch, GraphicsCursor cursor, GameTime gameTime)
        {
            spriteBatch.Draw(Image, cursor.Position, Color.White * cursor.Alpha);

              cursor.Y += Image.Height / 2;
              cursor.X -= 20;

              return 10 + Math.Max(Image.Height, Line.Draw(spriteBatch, cursor, gameTime));
        }
        /// <summary>
        /// Draw the current state of this view to the screen.
        /// </summary>
        /// <param name="spriteBatch"></param>
        /// <param name="gameTime"></param>
        public void Draw(SpriteBatch spriteBatch, GameTime gameTime)
        {
            float transitionOffset = (float)Math.Pow(TransitionPosition, 2);
              Vector2 origin = new Vector2(spriteBatch.GraphicsDevice.Viewport.Width / 2, 0);

              GraphicsCursor cursor = new GraphicsCursor();
              cursor.Position = origin;

              spriteBatch.Begin();

              // Draw the title
              cursor.Y = 80.0f;
              if (Title != null) {
            GraphicsCursor titleCursor = cursor;

            // Shift the title based on the current transition state.
            titleCursor = (new OffsetEffect(0, -transitionOffset * 100)).ApplyTo(titleCursor);

            Title.Draw(spriteBatch, titleCursor, gameTime);
              }

              // Draw the content
              cursor.Y = 175.0f;
              {
            GraphicsCursor lineCursor = cursor;

            // Modify the alpha to fade text out during transitions.
            lineCursor = (new AlphaEffect(1.0f - TransitionPosition)).ApplyTo(lineCursor);

            // Shift the text based on the current transition state.
            lineCursor = (new OffsetEffect(-transitionOffset * 256, 0)).ApplyTo(lineCursor);

            foreach (IMenuLine line in Lines)
              lineCursor.Y += line.Draw(spriteBatch, lineCursor, gameTime);
              }

              // Draw the buttons
              var labels = new Selection[] { Selection.Left, Selection.Middle, Selection.Right };

              ItemRects.Clear();

              cursor.X = origin.X / 3;
              cursor.Y = 550;
              foreach (Selection label in labels) {
            MenuButton button;
            Buttons.TryGetValue(label, out button);

            if (button != null) {
              GraphicsCursor buttonCursor = cursor;

              // Modify the alpha to fade text out during transitions.
              buttonCursor = (new AlphaEffect(1.0f - TransitionPosition)).ApplyTo(buttonCursor);

              Rectangle box = button.Draw(spriteBatch, buttonCursor, label == SelectedItem, gameTime);

              ItemRects.Add(Tuple.Create(box, button));
            }

            cursor.X += 2 * origin.X / 3;
              }

              spriteBatch.End();
        }
 public int Draw(SpriteBatch spriteBatch, GraphicsCursor cursor, GameTime gameTime)
 {
     return Height;
 }
        public int Draw(SpriteBatch spriteBatch, GraphicsCursor cursor, GameTime gameTime)
        {
            Vector2 origin = Font.MeasureString(Text) / 2;

              if (Align == TextAlignment.RIGHT)
            cursor = (new OffsetEffect(Width / 2, 0)).ApplyTo(cursor);
              else if (Align == TextAlignment.LEFT)
            cursor = (new OffsetEffect(-Width / 2, 0)).ApplyTo(cursor);

              Color color = Color * cursor.Alpha;
              spriteBatch.DrawString(Font, Text, cursor.Position, color, 0,
                                origin, Scale, SpriteEffects.None, 0);

              return Height;
        }
        /// <summary>
        /// Draw the current state of this view to the screen.
        /// </summary>
        /// <param name="spriteBatch"></param>
        /// <param name="gameTime"></param>
        public void Draw(SpriteBatch spriteBatch, GameTime gameTime)
        {
            float transitionOffset = (float)Math.Pow(TransitionPosition, 2);
              Vector2 origin = new Vector2(spriteBatch.GraphicsDevice.Viewport.Width / 2, 0);

              GraphicsCursor cursor = new GraphicsCursor();
              cursor.Position = origin;

              spriteBatch.Begin();

              // Draw the title
              cursor.Y = 80;
              if (Title != null) {
            GraphicsCursor titleCursor = cursor;

            // Shift the title based on the current transition state.
            titleCursor = (new OffsetEffect(0, -transitionOffset * 100)).ApplyTo(titleCursor);

            Title.Draw(spriteBatch, titleCursor, gameTime);
              }

              ItemRects.Clear();

              // Draw the menu items
              cursor.Y = 175;
              for (var i = 0; i < Items.Count; ++i) {
            MenuButton button = Items[i];
            GraphicsCursor buttonCursor = cursor;

            // Shift the button based on the current transition state.
            buttonCursor = (new OffsetEffect(-transitionOffset * 256, 0)).ApplyTo(buttonCursor);

            // Modify the alpha to fade text out during transitions.
            buttonCursor = (new AlphaEffect(1.0f - TransitionPosition)).ApplyTo(buttonCursor);

            // Draw the button.
            Rectangle box = button.Draw(spriteBatch, buttonCursor, SelectedItem == i, gameTime);

            ItemRects.Add(Tuple.Create(box, button));

            cursor.Y += box.Height;
              }

              spriteBatch.End();
        }
        public void Draw(SpriteBatch spriteBatch, GameTime gameTime, SpriteFont font, float transitionAlpha,
            Color color, Texture2D gradientTexture)
        {
            float transitionOffset = (float)Math.Pow(TransitionPosition, 2);
              Vector2 origin = new Vector2(spriteBatch.GraphicsDevice.Viewport.Width / 2, 0);

              // Darken down any other screens that were drawn beneath the popup.
              spriteBatch.FadeBackBufferToBlack(transitionAlpha * 2 / 3);

              GraphicsCursor cursor = new GraphicsCursor();
              cursor.Position = origin;

              spriteBatch.Begin();

              Rectangle backgroundRectangle = new Rectangle(RectangleXPosition, RectangleYPosition,
                                                    ReactangleWidth, RectangleHeight);

              // Draw the background rectangle.
              spriteBatch.Draw(gradientTexture, backgroundRectangle, color);

              // Draw the title
              cursor.Y = backgroundRectangle.Top + font.LineSpacing;

              if (Title != null) {
            GraphicsCursor titleCursor = cursor;

            //Shift the title based on the current transition state.
            titleCursor = (new OffsetEffect(0, -transitionOffset * 100)).ApplyTo(titleCursor);

            Title.Draw(spriteBatch, titleCursor, gameTime);
              }

              //Draw the content
              cursor.Y = 175.0f;
              {
            GraphicsCursor lineCursor = cursor;

            // Modify the alpha to fade text out during transitions.
            lineCursor = (new AlphaEffect(1.0f - TransitionPosition)).ApplyTo(lineCursor);

            // Shift the text based on the current transition state.
            lineCursor = (new OffsetEffect(-transitionOffset * 256, 0)).ApplyTo(lineCursor);

            foreach (IMenuLine line in Lines)
              lineCursor.Y += line.Draw(spriteBatch, lineCursor, gameTime);
              }

              // Draw the buttons
              var labels = new Selection[] { Selection.Left, Selection.Middle, Selection.Right };

              ItemRects.Clear();

              cursor.X = backgroundRectangle.X + 100;
              cursor.Y = backgroundRectangle.Bottom - font.LineSpacing; // This was changed - Jorenz

              foreach (Selection label in labels) {
            MenuButton button;
            Buttons.TryGetValue(label, out button);

               if (button != null) {
              GraphicsCursor buttonCursor = cursor;

              // Modify the alpha to fade text out during transitions.
              buttonCursor = (new AlphaEffect(1.0f - TransitionPosition)).ApplyTo(buttonCursor);

              Rectangle box = button.Draw(spriteBatch, buttonCursor, label == SelectedItem, gameTime);

              ItemRects.Add(Tuple.Create(box, button));
            }

            cursor.X += backgroundRectangle.Width / 3;
              }

              spriteBatch.End();
        }
        /// <summary>
        /// Draws the menu entry. This can be overridden to customize the appearance.
        /// </summary>
        public virtual Rectangle Draw(SpriteBatch spriteBatch, GraphicsCursor cursor, bool isSelected, GameTime gameTime)
        {
            // Vertically center text on the middle of each line.
              Vector2 origin = new Vector2(0, Font.LineSpacing / 2);

              // Pulsate the size of the selected menu entry.
              double time = gameTime.TotalGameTime.TotalSeconds;
              float pulsate = (float)Math.Sin(time * 6) + 1;
              float scale = 1 + pulsate * 0.05f * selectionFade;

              cursor = (new ScaleEffect(scale)).ApplyTo(cursor);

              cursor = (new OffsetEffect(-scale * Font.MeasureString(Text).X / 2, 0)).ApplyTo(cursor);

              Color color = Color * cursor.Alpha;
              spriteBatch.DrawString(Font, Text, cursor.Position, color, 0,
                             origin, cursor.Scaling, SpriteEffects.None, 0);

              return new Rectangle(
            (int)cursor.X, (int)(cursor.Y - Font.LineSpacing / 2),
            (int)(scale * Font.MeasureString(Text).X), Font.LineSpacing);
        }
        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            menuTemplate.Draw(spriteBatch, gameTime);

              // Display a warning message if the currently selected controller isn't even connected.
              if (!currentControllerConnected) {
            // Um...should the template really be in charge of calling Begin and End?
            // Or should it be the Screen's job? - Jorenz
            spriteBatch.Begin();

            GraphicsCursor cursor = new GraphicsCursor();
            cursor.Position = new Vector2(400, 400);

            // Modify the alpha to fade text out during transitions.
            cursor = (new AlphaEffect(1.0f - TransitionPosition)).ApplyTo(cursor);

            // Draw the warning messages.
            firstWarningLine.Draw(spriteBatch, cursor, gameTime);
            cursor.Y += 50;
            secondWarningLine.Draw(spriteBatch, cursor, gameTime);

            spriteBatch.End();
              }
        }