本文整理汇总了C#中GameStateManagement.MenuEntry类的典型用法代码示例。如果您正苦于以下问题:C# MenuEntry类的具体用法?C# MenuEntry怎么用?C# MenuEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MenuEntry类属于GameStateManagement命名空间,在下文中一共展示了MenuEntry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainMenuScreen
/// <summary>
/// Constructor fills in the menu contents.
/// </summary>
public MainMenuScreen()
: base("Main Menu")
{
// Create our menu entries.
MenuEntry playGameMenuEntry = new MenuEntry("Play Game");
//MenuEntry highScoresMenuEntry = new MenuEntry("High Scores");
//MenuEntry nameEntryMenuEntry = new MenuEntry("Name Entry");
MenuEntry controlsMenuEntry = new MenuEntry("Instructions");
MenuEntry optionsMenuEntry = new MenuEntry("Options");
MenuEntry exitMenuEntry = new MenuEntry("Back To Title Screen");
MenuEntry returnToArcadeEntry = new MenuEntry("Return To Arcade");
// Hook up menu event handlers.
playGameMenuEntry.Selected += PlayGameMenuEntrySelected;
//highScoresMenuEntry.Selected += HighScoresEntrySelected;
//nameEntryMenuEntry.Selected += NameSel;
controlsMenuEntry.Selected += ControlsMenuEntrySelected;
optionsMenuEntry.Selected += OptionsMenuEntrySelected;
exitMenuEntry.Selected += OnCancel;
returnToArcadeEntry.Selected += ReturnToArcadeSelected;
// Add entries to the menu.
MenuEntries.Add(playGameMenuEntry);
//MenuEntries.Add(highScoresMenuEntry);
//MenuEntries.Add(nameEntryMenuEntry);
MenuEntries.Add(controlsMenuEntry);
MenuEntries.Add(optionsMenuEntry);
MenuEntries.Add(exitMenuEntry);
MenuEntries.Add(returnToArcadeEntry);
#if !XBOX
returnToArcadeEntry.Text = "Return To Windows";
#endif
}
示例2: OptionsMenuScreen
/// <summary>
/// Конструктор.
/// </summary>
public OptionsMenuScreen()
: base("Options")
{
// Создаем пункты входа меню.
ungulateMenuEntry = new MenuEntry(string.Empty);
languageMenuEntry = new MenuEntry(string.Empty);
frobnicateMenuEntry = new MenuEntry(string.Empty);
elfMenuEntry = new MenuEntry(string.Empty);
SetMenuEntryText();
MenuEntry back = new MenuEntry("Back");
// Подключаем меню обработчика событий.
ungulateMenuEntry.Selected += UngulateMenuEntrySelected;
languageMenuEntry.Selected += LanguageMenuEntrySelected;
frobnicateMenuEntry.Selected += FrobnicateMenuEntrySelected;
elfMenuEntry.Selected += ElfMenuEntrySelected;
back.Selected += OnCancel;
// Добавляем запись в меню.
MenuEntries.Add(ungulateMenuEntry);
MenuEntries.Add(languageMenuEntry);
MenuEntries.Add(frobnicateMenuEntry);
MenuEntries.Add(elfMenuEntry);
MenuEntries.Add(back);
}
示例3: PressStartScreen
public PressStartScreen()
: base("")
{
MenuEntry startMenuEntry = new MenuEntry("Press Start to continue");
startMenuEntry.Selected += StartMenuEntrySelected;
MenuEntries.Add(startMenuEntry);
}
示例4: OptionsScreen
public OptionsScreen()
: base(String.Empty)
{
//Read the sound state from the text file and determine the value of soundOn
OptionsScreen.soundOn = IsSoundOn();
IsPopup = true;
soundOptionMenuEntry = new MenuEntry("");
creditsOptionMenuEntry = new MenuEntry("CREDITS");
backOptionMenuEntry = new MenuEntry("BACK");
//Add methods to menu entry event handlers
soundOptionMenuEntry.Selected += SoundOptionSelected;
creditsOptionMenuEntry.Selected += CreditsOptionSelected;
backOptionMenuEntry.Selected += BackOptionSelected;
//Add menu entries to menu entries list
MenuEntries.Add(soundOptionMenuEntry);
MenuEntries.Add(creditsOptionMenuEntry);
MenuEntries.Add(backOptionMenuEntry);
//Write the sound state to the text file
OptionsScreen.SaveSound();
}
示例5: OptionsMenuScreen
/// <summary>
/// Constructor.
/// </summary>
public OptionsMenuScreen()
: base("Options")
{
LoadBoardList();
isFullScreen = GameStateManagementGame.FullScreen;
board = new MenuEntry(string.Empty);
fullScreen = new MenuEntry(string.Empty);
soundsVolume = new MenuEntry(string.Empty);
SetMenuEntryText();
MenuEntry backMenuEntry = new MenuEntry("Back");
// Hook up menu event handlers.
board.Selected += BoardMenuEntrySelected;
fullScreen.Selected += FullScreenSelected;
soundsVolume.Selected += soundsVolumeSelected;
backMenuEntry.Selected += OnSave;
// Add entries to the menu.
MenuEntries.Add(board);
MenuEntries.Add(fullScreen);
MenuEntries.Add(soundsVolume);
MenuEntries.Add(backMenuEntry);
}
示例6: ControlsMenuScreen
/// <summary>
/// Constructor.
/// </summary>
public ControlsMenuScreen()
: base("Controls")
{
MenuEntry back = new MenuEntry("");
back.Selected += OnCancel;
MenuEntries.Add(back);
}
示例7: PauseMenuScreen
/// <summary>
/// Constructor.
/// </summary>
public PauseMenuScreen()
: base("Paused")
{
// Flag that there is no need for the game to transition
// off when the pause menu is on top of it.
IsPopup = true;
// Create our menu entries.
MenuEntry resumeGameMenuEntry = new MenuEntry("Resume Game");
MenuEntry controls = new MenuEntry("Controls");
MenuEntry quitGameMenuEntry = new MenuEntry("Quit Game");
// Hook up menu event handlers.
resumeGameMenuEntry.Selected += OnCancel;
controls.Selected += new System.EventHandler<PlayerIndexEventArgs>(controls_Selected);
controls.Selected += OnCancel;
quitGameMenuEntry.Selected += QuitGameMenuEntrySelected;
// Add entries to the menu.
MenuEntries.Add(resumeGameMenuEntry);
MenuEntries.Add(controls);
MenuEntries.Add(quitGameMenuEntry);
}
示例8: MainMenuScreen
/// <summary>
/// Constructor fills in the menu contents.
/// </summary>
public MainMenuScreen()
: base("Main Menu")
{
// Create our menu entries.
MenuEntry playGameMenuEntry = new MenuEntry("Play Game");
// MenuEntry optionsMenuEntry = new MenuEntry("Options");
//lataaminen
MenuEntry LoadMenuEntry = new MenuEntry("Load saved game");
MenuEntry exitMenuEntry = new MenuEntry("Exit");
// Hook up menu event handlers.
playGameMenuEntry.Selected += PlayGameMenuEntrySelected;
// optionsMenuEntry.Selected += OptionsMenuEntrySelected;
LoadMenuEntry.Selected += LoadMenuEntrySelected;
exitMenuEntry.Selected += OnCancel;
// Add entries to the menu.
MenuEntries.Add(playGameMenuEntry);
//MenuEntries.Add(optionsMenuEntry);
MenuEntries.Add(LoadMenuEntry);
MenuEntries.Add(exitMenuEntry);
}
示例9: JoinSessionScreen
/// <summary>
/// Constructs a menu screen listing the available network sessions.
/// </summary>
public JoinSessionScreen(AvailableNetworkSessionCollection availableSessions)
: base(Resources.JoinSession)
{
this.availableSessions = availableSessions;
foreach (AvailableNetworkSession availableSession in availableSessions)
{
// Create menu entries for each available session.
MenuEntry menuEntry = new AvailableSessionMenuEntry(availableSession);
menuEntry.Selected += AvailableSessionMenuEntrySelected;
MenuEntries.Add(menuEntry);
// Matchmaking can return up to 25 available sessions at a time, but
// we don't have room to fit that many on the screen. In a perfect
// world we should make the menu scroll if there are too many, but it
// is easier to just not bother displaying more than we have room for.
if (MenuEntries.Count >= MaxSearchResults)
break;
}
// Add the Back menu entry.
MenuEntry backMenuEntry = new MenuEntry(Resources.Back);
backMenuEntry.Selected += BackMenuEntrySelected;
MenuEntries.Add(backMenuEntry);
}
示例10: PlayersMenuScreen
/// <summary>
/// Constructor.
/// </summary>
public PlayersMenuScreen()
: base("Players", new Vector2(450, 510))
{
// Create our menu entries.
player1MenuEntry = new MenuEntry(string.Empty);
player2MenuEntry = new MenuEntry(string.Empty);
player3MenuEntry = new MenuEntry(string.Empty);
player4MenuEntry = new MenuEntry(string.Empty);
SetMenuEntryText();
MenuEntry backMenuEntry = new MenuEntry("Back");
// Hook up menu event handlers.
player1MenuEntry.Selected += Player1MenuEntrySelected;
player2MenuEntry.Selected += Player2MenuEntrySelected;
player3MenuEntry.Selected += Player3MenuEntrySelected;
player4MenuEntry.Selected += Player4MenuEntrySelected;
backMenuEntry.Selected += OnCancel;
// Add entries to the menu.
MenuEntries.Add(player1MenuEntry);
MenuEntries.Add(player2MenuEntry);
MenuEntries.Add(player3MenuEntry);
MenuEntries.Add(player4MenuEntry);
MenuEntries.Add(backMenuEntry);
}
示例11: HighScoreScreen
/// <summary>
/// Constructor fills in the menu contents.
/// </summary>
public HighScoreScreen()
: base("High Scores")
{
//HighScores2.GoLoad();
//HighScores.SaveHighScore();
scoreEntries = new MenuEntry[HighScores2.loadedHighScoreData.Count];
//HighScoreData hsd = HighScores.LoadHighScores();
//HighScores2.loadedHighScoreData.PlayerName = new string[5];
songNameEntry = new MenuEntry(NarlyGame.currentSong);
songNameEntry.Selected += OnCancel;
// MenuEntries.Add(songNameEntry);
for (int i = 0; i < HighScores2.loadedHighScoreData.Count; i++)
{
//HighScores2.loadedHighScoreData.PlayerName[i] = new string('a',3);
//HighScores2.loadedHighScoreData.PlayerName[i] = "pleasework";
scoreEntries[i] = new MenuEntry(
HighScores2.loadedHighScoreData.PlayerName[i]
+ " " +
HighScores2.loadedHighScoreData.Score[i]);
scoreEntries[i].Selected += OnCancel;
MenuEntries.Add(scoreEntries[i]);
}
}
示例12: 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();
}
示例13: PauseScreen
public PauseScreen(GameScreen backgroundScreen, Player human, Player computer)
: base(String.Empty)
{
IsPopup = true;
this.backgroundScreen = backgroundScreen;
// Create our menu entries.
MenuEntry startGameMenuEntry = new MenuEntry("Return");
MenuEntry exitMenuEntry = new MenuEntry("Quit Game");
// Hook up menu event handlers.
startGameMenuEntry.Selected += StartGameMenuEntrySelected;
exitMenuEntry.Selected += OnCancel;
// Add entries to the menu.
MenuEntries.Add(startGameMenuEntry);
MenuEntries.Add(exitMenuEntry);
this.human = human;
this.computer = computer;
// Preserve the old state of the game
prevHumanIsActive = this.human.Catapult.IsActive;
prevCompuerIsActive = this.computer.Catapult.IsActive;
// Pause the game logic progress
this.human.Catapult.IsActive = false;
this.computer.Catapult.IsActive = false;
AudioManager.PauseResumeSounds(false);
}
示例14: OptionsMenuScreen
/// <summary>
/// Constructor.
/// </summary>
public OptionsMenuScreen()
: base("Options")
{
// Create our menu entries.
soundMenuEntry = new MenuEntry(string.Empty);
//languageMenuEntry = new MenuEntry(string.Empty);
screenMenuEntry = new MenuEntry(string.Empty);
//elfMenuEntry = new MenuEntry(string.Empty);
setFullscreen = false;
soundOnOff = true;
//graphics = new GraphicsDeviceManager(this);
SetMenuEntryText();
MenuEntry back = new MenuEntry("Back");
// Hook up menu event handlers.
soundMenuEntry.Selected += soundMenuEntrySelected;
//languageMenuEntry.Selected += LanguageMenuEntrySelected;
screenMenuEntry.Selected += screenMenuEntrySelected;
// elfMenuEntry.Selected += ElfMenuEntrySelected;
back.Selected += OnCancel;
// Add entries to the menu.
MenuEntries.Add(soundMenuEntry);
// MenuEntries.Add(languageMenuEntry);
MenuEntries.Add(screenMenuEntry);
//MenuEntries.Add(elfMenuEntry);
MenuEntries.Add(back);
}
示例15: EndScreen
/// <summary>
/// Constructor.
/// </summary>
public EndScreen()
: base("")
{
MenuEntry back = new MenuEntry("");
back.Selected += BackToMenu;
MenuEntries.Add(back);
}