private void CreateMenu() { Rectangle ButtonSize = new Rectangle(0, 0, 58, 15); MenuView = new UIStackView(UIStackDirection.Horizontal, true); UIToggleButton InventoryToggle = new UIToggleButton("Player"); InventoryToggle.Bounds = ButtonSize; InventoryToggle.ButtonToggled += delegate(UIToggleButton Button, MouseState mouse) { if (Button.On && InventoryView == null) { InventoryView = new InventoryPanel(Desktop); AddWindow(InventoryView); } else if (!Button.On && InventoryView != null) { InventoryView.RemoveFromSuperview(); InventoryView = null; } }; MenuView.AddSubview(InventoryToggle); UIToggleButton SkillToggle = new UIToggleButton("Skills"); SkillToggle.Bounds = ButtonSize; SkillToggle.ButtonToggled += delegate(UIToggleButton Button, MouseState mouse) { if (Button.On && SkillsView == null) { SkillsView = new SkillPanel(Desktop); SkillsView.Bounds.Width = 176; SkillsView.Bounds.Height = 180; AddWindow(SkillsView); } else if (!Button.On && SkillsView != null) { SkillsView.RemoveFromSuperview(); SkillsView = null; } }; MenuView.AddSubview(SkillToggle); UIToggleButton BattleToggle = new UIToggleButton("Battle"); BattleToggle.Bounds = ButtonSize; MenuView.AddSubview(BattleToggle); UIToggleButton VIPToggle = new UIToggleButton("VIP"); VIPToggle.Bounds = ButtonSize; VIPToggle.ButtonToggled += delegate(UIToggleButton Button, MouseState mouse) { if (Button.On && VIPView == null) { VIPView = new VIPPanel(Desktop); AddWindow(VIPView); } else if (!Button.On && VIPView != null) { VIPView.RemoveFromSuperview(); VIPView = null; } }; MenuView.AddSubview(VIPToggle); UIButton MapToggle = new UIButton("Map"); MapToggle.Bounds = ButtonSize; MenuView.AddSubview(MapToggle); UIButton MenuToggle = new UIButton("Menu"); MenuToggle.Bounds = ButtonSize; MenuView.AddSubview(MenuToggle); AddSubview(MenuView); }