Ejemplo n.º 1
0
        /// <summary>
        /// Draws the Menu Entry onto the screen.
        /// </summary>
        /// <param name="gameTime">Current GameTime.</param>
        /// <param name="isSelected">Specifies if the item is currently selected.</param>
        /// <param name="screen">The screen this entry belongs to.</param>
        public virtual void Draw(GameTime gameTime, bool isSelected, MenuScreen screen)
        {
            //A selected entry is brighter than a non-selected entry.
            Color entryColor = isSelected ? Color.LimeGreen: Color.Green;

            //Set up rendering objects
            SpriteBatch spriteBatch = screen.ScreenManager.SpriteBatch;
            SpriteFont spriteFont = screen.ScreenManager.Font;

            //Draw the menu item to the screen.
            spriteBatch.DrawString(spriteFont,
                this.text,
                this.position,
                entryColor);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Calulates the height of the entry.
 /// </summary>
 /// <param name="screen">The screen this entry belongs to.</param>
 /// <returns></returns>
 public int GetHeight(MenuScreen screen)
 {
     return (int)screen.ScreenManager.Font.MeasureString(this.text).Y;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Updates the Menu Entry.
 /// </summary>
 /// <param name="gameTime">Current GameTime.</param>
 /// <param name="isSelected">Specifies if the item is currently selected.</param>
 /// <param name="screen">The screen this entry belongs to.</param>
 public virtual void Update(GameTime gameTime, bool isSelected, MenuScreen screen)
 {
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Calulates the width of the entry.
 /// </summary>
 /// <param name="screen">The screen this entry belongs to.</param>
 /// <returns></returns>
 public int GetWidth(MenuScreen screen)
 {
     return (int)screen.ScreenManager.Font.MeasureString(this.text).X;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Updates the Menu Entry.
 /// </summary>
 /// <param name="gameTime">Current GameTime.</param>
 /// <param name="isSelected">Specifies if the item is currently selected.</param>
 /// <param name="screen">The screen this entry belongs to.</param>
 public virtual void Update(GameTime gameTime, bool isSelected, MenuScreen screen)
 {
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Calulates the height of the entry.
 /// </summary>
 /// <param name="screen">The screen this entry belongs to.</param>
 /// <returns></returns>
 public int GetHeight(MenuScreen screen)
 {
     return((int)screen.ScreenManager.Font.MeasureString(this.text).Y);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Calulates the width of the entry.
 /// </summary>
 /// <param name="screen">The screen this entry belongs to.</param>
 /// <returns></returns>
 public int GetWidth(MenuScreen screen)
 {
     return((int)screen.ScreenManager.Font.MeasureString(this.text).X);
 }