当前位置: 首页>>代码示例>>C#>>正文


C# MenuButton.Initialize方法代码示例

本文整理汇总了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
        }
开发者ID:JoshuaKennedy,项目名称:DarkHavoc,代码行数:28,代码来源:MainMenuScreen_old.cs


注:本文中的MenuButton.Initialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。