Example #1
0
        public virtual void Update(MenuScreen screen, bool isSelected, GameTime gameTime)
        {
            // there is no such thing as a selected item on Windows Phone, so we always
            // force isSelected to be false
#if WINDOWS_PHONE
            isSelected = false;
#endif
            float fadeSpeed = (float)gameTime.ElapsedGameTime.TotalSeconds * 2;

            if (isSelected)
                selectionFade = Math.Min(selectionFade + fadeSpeed, 1);
            else
                selectionFade = Math.Max(selectionFade - fadeSpeed, 0);
        }
Example #2
0
        public virtual void Draw(MenuScreen screen, bool isSelected, GameTime gameTime)
        {
#if WINDOWS_PHONE || PS_VITA
            isSelected = false;
#endif
            Color color = enabled ? isSelected ? Color.OrangeRed : Color.WhiteSmoke : Color.SlateGray;

            color *= screen.TransitionAlpha;

            ScreenManager screenManager = screen.ScreenManager;
            SpriteBatch spriteBatch = screenManager.SpriteBatch;
            SpriteFont font = Assets.menuFont;

            Vector2 origin = new Vector2(0, font.LineSpacing / 2);

            ShadowedString.DrawShadowedString(font, text, position, color, 0, origin, 1.0f, spriteBatch);
        }
Example #3
0
 /// <summary>
 /// Queries how wide the entry is, used for centering on the screen.
 /// </summary>
 public virtual int GetWidth(MenuScreen screen)
 {
     return (int)Assets.menuFont.MeasureString(text).X;
 }
Example #4
0
 /// <summary>
 /// Queries how much space this menu entry requires.
 /// </summary>
 public virtual int GetHeight(MenuScreen screen)
 {
     return Assets.menuFont.LineSpacing;
 }