本文整理汇总了C#中MenuButton.Initialize方法的典型用法代码示例。如果您正苦于以下问题:C# MenuButton.Initialize方法的具体用法?C# MenuButton.Initialize怎么用?C# MenuButton.Initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MenuButton
的用法示例。
在下文中一共展示了MenuButton.Initialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadContent
public override void LoadContent()
{
// Set the mouse to be visible so the user can see the mouse to use the UI.
ScreenManager.Game.IsMouseVisible = true;
// Get the center of the screen (right under the Dark Havoc logo).
centerOfScreen = new Vector2(ScreenManager.GraphicsDevice.Viewport.TitleSafeArea.Center.X, ScreenManager.GraphicsDevice.Viewport.TitleSafeArea.Center.Y + (Assets.darkHavocLogo.Height / 2) + 30);
// Play Button initialization
playGameButton = new MenuButton(centerOfScreen, "Play!");
playGameButton.Selected += new EventHandler<EventArgs>(playGameButton_Selected);
playGameButton.Position = new Vector2(centerOfScreen.X - (MenuButton.ButtonWidth * 2) - 25, centerOfScreen.Y);
playGameButton.Initialize();
// Options/Help button initialization
optionsHelpButton = new MenuButton(centerOfScreen, "Options");
optionsHelpButton.Selected += new EventHandler<EventArgs>(optionsHelpButton_Selected);
optionsHelpButton.Position = new Vector2(centerOfScreen.X - (MenuButton.ButtonWidth / 2), centerOfScreen.Y);
optionsHelpButton.Initialize();
#if WINDOWS
// Exit button initialization
exitButton = new MenuButton(centerOfScreen, "Exit Game");
exitButton.Selected += new EventHandler<EventArgs>(exitButton_Selected);
exitButton.Position = new Vector2(centerOfScreen.X + MenuButton.ButtonWidth + 25, centerOfScreen.Y);
exitButton.Initialize();
#endif
}