Beispiel #1
0
        public void Draw(MenuScreen menuScreen,GameTime gameTime, bool isSelected)
        {
            ++i;
            SpriteBatch spriteBatch = menuScreen.ScreenManager.SpriteBatch;

            // determine the scale using a sine function
            float pulsate =  6 +  (float)Math.Sin(gameTime.TotalGameTime.TotalSeconds * 6);
            Color color = isSelected? Color.Yellow  : Color.White;
            color = color * menuScreen.TransitionAlpha;
            float scale = 2 + 0.05f * pulsate * selectionFade;
            Debug.WriteLine("Position of {0} is X: {1}, Y: {2}", title,position.X, position.Y);
            spriteBatch.DrawString(menuScreen.ScreenManager.SpriteFont, title, position, color,0,Vector2.Zero,scale,SpriteEffects.None,0);
        }
Beispiel #2
0
 public float GetWidth(MenuScreen menuScreen)
 {
     return menuScreen.ScreenManager.SpriteFont.MeasureString(title).X;
 }
Beispiel #3
0
 public float GetHeight(MenuScreen menuScreen)
 {
     return menuScreen.ScreenManager.SpriteFont.LineSpacing;
 }