public void Draw(AbstractMenuScene scene, bool isSelected, GameTime gameTime) { Color color = isSelected ? Color.Black : Color.White; double time = gameTime.TotalGameTime.TotalSeconds; float pulsate = (float)Math.Sin(time * 6) + Scale; float scale = Scale + pulsate * 0.05f * _selectionFade; color *= scene.TransitionAlpha; SceneManager sceneManager = scene.SceneManager; SpriteBatch spriteBatch = sceneManager.SpriteBatch; SpriteFont font = sceneManager.Font; var origin = new Vector2(0, font.LineSpacing / 2f); spriteBatch.DrawString(font, _text, _position, color, 0, origin, scale, SpriteEffects.None, 0); }
public int GetWidth(AbstractMenuScene scene) { return (int)(scene.SceneManager.Font.MeasureString(_text).X * Scale); }
public static int GetHeight(AbstractMenuScene scene) { return (int)(scene.SceneManager.Font.LineSpacing * Scale); }