本文整理汇总了C#中Microsoft.Xna.Framework.Rectangle.Center方法的典型用法代码示例。如果您正苦于以下问题:C# Rectangle.Center方法的具体用法?C# Rectangle.Center怎么用?C# Rectangle.Center使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Xna.Framework.Rectangle
的用法示例。
在下文中一共展示了Rectangle.Center方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadContent
/// <summary>
/// Loads content required by the screen, and initializes the displayed menu.
/// </summary>
public override void LoadContent()
{
safeArea = ScreenManager.SafeArea;
// Create our menu entries.
MenuEntry themeGameMenuEntry = new MenuEntry("Deck");
MenuEntry returnMenuEntry = new MenuEntry("Return");
// Hook up menu event handlers.
themeGameMenuEntry.Selected += ThemeGameMenuEntrySelected;
returnMenuEntry.Selected += OnCancel;
// Add entries to the menu.
MenuEntries.Add(themeGameMenuEntry);
MenuEntries.Add(returnMenuEntry);
themes.Add("Red", ScreenManager.Game.Content.Load<Texture2D>(
@"Images\Cards\CardBack_Red"));
themes.Add("Blue", ScreenManager.Game.Content.Load<Texture2D>(
@"Images\Cards\CardBack_Blue"));
background = ScreenManager.Game.Content.Load<Texture2D>(
@"Images\UI\table");
card = new AnimatedGameComponent(ScreenManager.Game,
themes[MainMenuScreen.Theme])
{
CurrentPosition = new Vector2(safeArea.Center().X, safeArea.Center().Y - 50)
};
ScreenManager.Game.Components.Add(card);
base.LoadContent();
}