Exemplo n.º 1
0
        public override void Draw()
        {
            Quads.Begin();
            Quads.Render(_topLeft, _bottomRight, null, true, Colors.Black, Colors.Grey * 0.95f);
            Quads.End();

            // Draw each menu entry in turn.
            Quads.Begin();
            foreach (OptionEntry entry in _optionEntries)
            {
                Quads.Render(entry.Position - _optionEntrySize / 2f, entry.Position + _optionEntrySize / 2f, null, true, Colors.Black * TransitionAlpha, entry.TileColor * TransitionAlpha);
                Quads.Render(entry.Position - _optionEntrySize / 2f + _optionCheckOffset, entry.Position + _optionEntrySize / 2f, null, true, Colors.Black * TransitionAlpha, entry.TileColor * TransitionAlpha);
            }

            Quads.End();

            Sprites.Begin();
            foreach (OptionEntry entry in _optionEntries)
            {
                Sprites.DrawString(_font, entry.Text, entry.Position + Vector2.One + _optionTextOffset, Colors.Black * TransitionAlpha, 0f, entry.Origin, entry.Scale, SpriteEffects.None, 0f);
                Sprites.DrawString(_font, entry.Text, entry.Position + _optionTextOffset, entry.TextColor * TransitionAlpha, 0f, entry.Origin, entry.Scale, SpriteEffects.None, 0f);
                Sprites.Draw(_checkmark, entry.Position - _optionEntrySize / 2f + _optionCheckOffset, Color.White * entry.CheckedFade);
            }

            Sprites.End();
        }
        /// <summary>
        /// Draws the message box.
        /// </summary>
        public override void Draw(GameTime gameTime)
        {
            Quads.Begin();
            Quads.Render(_topLeft, _bottomRight, null, true, ContentWrapper.Black, ContentWrapper.Grey * 0.65f);
            Quads.End();

            SpriteBatch.Begin();
            // Draw the message box text.
            SpriteBatch.DrawString(_font, _message, _textPosition + Vector2.One, ContentWrapper.Black);
            SpriteBatch.DrawString(_font, _message, _textPosition, ContentWrapper.Beige);
            SpriteBatch.End();
        }
Exemplo n.º 3
0
        /// <summary>Draws the message box.</summary>
        public override void Draw()
        {
            Quads.Begin();
            Quads.Render(_topLeft, _bottomRight, null, true, Colors.Black, Colors.Grey * 0.65f);
            Quads.End();

            Sprites.Begin();

            // Draw the message box text.
            Sprites.DrawString(_font, _message, _textPosition + Vector2.One, Colors.Black);
            Sprites.DrawString(_font, _message, _textPosition, Colors.Beige);
            Sprites.End();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Draws the menu.
        /// </summary>
        public override void Draw(GameTime gameTime)
        {
            Vector2 transitionOffset = new Vector2(0f, (float)Math.Pow(TransitionPosition, 2) * 90f);

            // Draw each menu entry in turn.
            Quads.Begin();
            foreach (MenuEntry entry in _menuEntries)
            {
                Quads.Render(entry.Position - _menuEntrySize / 2f, entry.Position + _menuEntrySize / 2f, null, true,
                             ContentWrapper.Grey * entry.Alpha * TransitionAlpha, entry.TileColor * entry.Alpha * TransitionAlpha);
            }

            Quads.Render(_menuSlider.Position - new Vector2(_menuEntrySize.Y / 2f),
                         _menuSlider.Position + new Vector2(_menuEntrySize.Y / 2f), null, true,
                         ContentWrapper.Grey * TransitionAlpha, _menuSlider.TileColor * TransitionAlpha);

            Quads.End();

            Sprites.Begin();
            foreach (MenuEntry entry in _menuEntries)
            {
                Sprites.DrawString(_font, entry.Text, entry.Position + Vector2.One, ContentWrapper.Black * entry.Alpha * entry.Alpha * TransitionAlpha,
                                   0f, entry.Origin, entry.Scale, SpriteEffects.None, 0f);
                Sprites.DrawString(_font, entry.Text, entry.Position, entry.TextColor * entry.Alpha * TransitionAlpha,
                                   0f, entry.Origin, entry.Scale, SpriteEffects.None, 0f);

                if (entry.Fade > 0f)
                {
                    Sprites.Draw(entry.Preview, PreviewPosition, null, Color.White * Math.Max((TransitionAlpha - 0.8f) / 0.2f, 0f) * entry.Fade, 0f, _previewOrigin, 1f, SpriteEffects.None, 0f);
                }
            }
            Sprites.End();

            Quads.Begin();
            Quads.Render(Vector2.Zero, new Vector2(Framework.GraphicsDevice.Viewport.Width, TitleBarHeight), null, ContentWrapper.Grey * 0.7f * TransitionAlpha);
            Quads.End();

            // Make the menu slide into place during transitions, using a
            // power curve to make things look more interesting (this makes
            // the movement slow down as it nears the end).
            Sprites.Begin();
            Sprites.Draw(_samplesLogo, _titlePosition - transitionOffset, null, Color.White, 0f, _titleOrigin, 1f, SpriteEffects.None, 0f);
            Sprites.End();
        }
Exemplo n.º 5
0
 /// <summary>
 /// Draws the background screen.
 /// </summary>
 public override void Draw(GameTime gameTime)
 {
     Quads.Begin();
     Quads.Render(Vector2.Zero, _viewportSize, null, ContentWrapper.Cyan, ContentWrapper.Ocean, ContentWrapper.Cyan, ContentWrapper.Sky);
     Quads.End();
 }
Exemplo n.º 6
0
 /// <summary>Draws the background screen.</summary>
 public override void Draw()
 {
     Quads.Begin();
     Quads.Render(Vector2.Zero, _viewportSize, null, Colors.Cyan, Colors.Ocean, Colors.Cyan, Colors.Sky);
     Quads.End();
 }