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); }
/// <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); }