public virtual void Update(MenuScreen aScreen, bool aIsSelected) { float fadeSpeed = (float)TimeManager.ElapsedGameTime.TotalSeconds * 16; if (aIsSelected) { _selectionFade = Math.Min(_selectionFade + fadeSpeed, 1); } else { _selectionFade = Math.Max(_selectionFade - fadeSpeed, 0); } }
public virtual void Draw(SpriteBatch aSpriteBatch, MenuScreen aScreen, bool aIsSelected, float aAlpha) { //Vector2 origin = new Vector2(0, font.LineSpacing / 2); this.TextColor = aIsSelected ? Color.Yellow : Color.White; this.TextColor *= aAlpha; if (this._text != String.Empty) { //draw the text //aSpriteBatch.DrawString(ScreenManager.MenuFont, _text, Position + TextOffset, color); aSpriteBatch.DrawString(ScreenManager.MenuFont, _text, Position, this.TextColor, _rotation, -TextOffset, _scale, SpriteEffects.None, 0f); } if (this._texture != null) { //draw the texture underneath the text aSpriteBatch.Draw(_texture, this.Position, this.TextureColor); } }