Beispiel #1
0
 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);
 }
Beispiel #2
0
 public int GetWidth(AbstractMenuScene scene)
 {
     return (int)(scene.SceneManager.Font.MeasureString(_text).X * Scale);
 }
Beispiel #3
0
 public static int GetHeight(AbstractMenuScene scene)
 {
     return (int)(scene.SceneManager.Font.LineSpacing * Scale);
 }