本文整理汇总了C#中Viewport.AddMenu方法的典型用法代码示例。如果您正苦于以下问题:C# Viewport.AddMenu方法的具体用法?C# Viewport.AddMenu怎么用?C# Viewport.AddMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewport
的用法示例。
在下文中一共展示了Viewport.AddMenu方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrepareMenuPhase2
private void PrepareMenuPhase2(string caption)
{
GTA.Menu menu = new GTA.Menu(String.Format(" {0}", caption), _menuItems.ToArray()) { Width = 400 };
_viewPort.MenuPosition = new Point(0, 0);
_viewPort = new Viewport();
_viewPort.AddMenu(menu);
_branch = 2;
}
示例2: MainMenu
void MainMenu()
{
GTA.MenuButton btnToggleInfection = new GTA.MenuButton("Toggle Infection");
GTA.MenuButton btnIncreaseRadius = new GTA.MenuButton("Increase Radius");
GTA.MenuButton btnDecreaseRadius = new GTA.MenuButton("Decrease Radius");
btnToggleInfection.Activated += btnToggleInfection_Activated;
btnIncreaseRadius.Activated += btnIncreaseRadius_Activated;
btnDecreaseRadius.Activated += btnDecreaseRadius_Activated;
_selectedItem = 0;
_menuItems = new List<GTA.IMenuItem>()
{
btnToggleInfection,
btnIncreaseRadius,
btnDecreaseRadius
};
_branch = 1;
GTA.Menu menu = new GTA.Menu("Infection by ZyDevs", _menuItems.ToArray()) { Width = 300 };
_viewPort = new Viewport();
menu.HeaderColor = Color.FromArgb(160, Color.Aqua);
menu.ItemHeight = 30;
menu.HeaderFont = GTA.Font.Pricedown;
menu.HeaderHeight = 35;
menu.SelectedItemColor = Color.FromArgb(150, Color.DimGray);
menu.SelectedTextColor = Color.FromArgb(255, Color.White);
menu.UnselectedTextColor = Color.FromArgb(255, Color.DodgerBlue);
menu.UnselectedItemColor = Color.FromArgb(175, Color.Black);
menu.HeaderFont = GTA.Font.ChaletComprimeCologne;
menu.FooterColor = Color.Transparent;
_viewPort.MenuPosition = new Point(1, 1);
_viewPort.AddMenu(menu);
_isMenuOpen = true;
}