Пример #1
0
 public void AddMenuItem(PhysicsDemoScreen screen, Texture2D preview)
 {
     MenuEntry entry = new MenuEntry(screen.GetTitle(), screen, preview);
     _menuEntrySize.X = Math.Max(_menuEntrySize.X, entry.Size.X + 20f);
     _menuEntrySize.Y = Math.Max(_menuEntrySize.Y, entry.Size.Y);
     _menuEntries.Add(entry);
 }
Пример #2
0
        /// <summary>
        /// Constructs a new menu entry with the specified text.
        /// </summary>
        public MenuEntry(string text, PhysicsDemoScreen screen, Texture2D preview)
        {
            _text = text;
            _screen = screen;
            _preview = preview;

            _hoverFade = 0.0;
            _selectionFade = 0.0;

            SpriteFont font = ContentWrapper.GetFont("MenuFont");
            _size = font.MeasureString(text);
        }
Пример #3
0
        /// <summary>
        /// Constructs a new menu entry with the specified text.
        /// </summary>
        public MenuEntry(string text, PhysicsDemoScreen screen, Texture2D preview)
        {
            _text    = text;
            _screen  = screen;
            _preview = preview;

            _hoverFade     = 0.0;
            _selectionFade = 0.0;

            SpriteFont font = ContentWrapper.GetFont("MenuFont");

            _size = font.MeasureString(text);
        }