public void Draw(SpriteBatch spriteBatch,SpriteFont font, int windowHeight, int windowWidth) { string displayString; MenuItemManager highscores = new MenuItemManager(11, font, windowHeight, windowWidth); highscores.setItem(0, "HIGHSCORES", MeniuItem.GlitterType.Always); for (int i = 1; i < Count + 1; i++) { displayString = iPoints[i - 1].ToString(); highscores.setItem(i, displayString, MeniuItem.GlitterType.None); } highscores.Draw(spriteBatch); }
private void setupOptionsMenu() { optionsMenu = new MenuItemManager(5, fontArcade, GraphicsDevice.Viewport.Height, GraphicsDevice.Viewport.Width); optionsMenu.setItem(0, "Borders"); optionsMenu.setItem(1, "Sound FX"); optionsMenu.setItem(2, "Background Music"); optionsMenu.setItem(3, "Moving Score"); optionsMenu.setItem(4, "Back"); }
private void setupMenu() { mainMenu = new MenuItemManager(5, fontArcade, GraphicsDevice.Viewport.Height, GraphicsDevice.Viewport.Width); mainMenu.setItem(0, "Play"); mainMenu.setItem(1, "Highscores"); mainMenu.setItem(2, "Options"); mainMenu.setItem(3, "Credits"); mainMenu.setItem(4, "Exit"); }
private void MeniuUpdate(MenuItemManager menu) { menu.onMouse(Mouse.GetState().X, Mouse.GetState().Y); }
private void MeniuClick(MenuItemManager menu) { string strResult = menu.onClick(Mouse.GetState().X, Mouse.GetState().Y); if (strResult == "Play") { BackgroundMusic(playMusic); gameStage = gameType; } else if (strResult == "Exit") End(); else if (strResult == "Options") { setupOptionsMenu(); gameStage = GameStage.Options; } else if (strResult == "Credits") gameStage = GameStage.Credits; else if (strResult == "Back") { setupMenu(); gameStage = GameStage.Meniu; } else if (strResult == "Sound FX") { optionsMenu.ToggleAct("Sound FX"); if (optionsMenu.IsActivated("Sound FX")) volSfx = 1f; else volSfx = 0f; } else if (strResult == "Background Music") { optionsMenu.ToggleAct("Background Music"); if (optionsMenu.IsActivated("Background Music")) { volBg = 1f; BackgroundMusic(meniuMusic); } else { volBg = 0f; BackgroundMusic(meniuMusic); } } else if (strResult == "Borders") { optionsMenu.ToggleAct("Borders"); if(optionsMenu.IsActivated("Borders")) gameType = GameStage.SinglePlayerWBorders; else gameType = GameStage.SinglePlayerBorderless; } else if (strResult == "Moving Score") { optionsMenu.ToggleAct("Moving Score"); if (optionsMenu.IsActivated("Moving Score")) { bMovingScore = true; } else { bMovingScore = false; } } else if (strResult == "Highscores") { gameStage = GameStage.Highscores; highScore = HighScores.LoadHighScores(); } }
private void DrawMeniu(MenuItemManager menu) { GraphicsDevice.Clear(Color.CornflowerBlue); spriteBatch.Begin(); menu.Draw(spriteBatch); /* spriteBatch.DrawString(fontArcade, "Play", new Vector2(400, 100), Color.White, 0, fontArcade.MeasureString("Play") / 2, 1.0f, SpriteEffects.None, 0.5f); spriteBatch.DrawString(fontArcade, "Options", new Vector2(400, 260), Color.White, 0, fontArcade.MeasureString("Options") / 2, 1.0f, SpriteEffects.None, 0.5f); spriteBatch.DrawString(fontArcade, "Exit", new Vector2(400, 420), Color.White, 0, fontArcade.MeasureString("Exit") / 2, 1.0f, SpriteEffects.None, 0.5f); */ spriteBatch.End(); }