/* * Draws the choosen popup with the buttons */ public void DisplayPopUp(SpectrumEnums.popUpId id) { // maybe a popup manager, to dispose popups after being x. switch (id) { case SpectrumEnums.popUpId.win: displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.win); break; case SpectrumEnums.popUpId.lose: displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.lose); break; case SpectrumEnums.popUpId.custom: displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.custom, "Not enough Ink", "You need to collect all the ink\n in order to proceed to the next level.\nGoogoos (enemies) also give ink!"); break; case SpectrumEnums.popUpId.musicSettings: displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.musicSettings); break; case SpectrumEnums.popUpId.deleteSaveFile: displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.deleteSaveFile); break; case SpectrumEnums.popUpId.gameAnalytics: displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.gameAnalytics); break; default: break; } displayedPopUp.Draw(spriteBatch); }
/* * Draws the choosen popup with the buttons */ public void DisplayPopUp(SpectrumEnums.popUpId id) { // maybe a popup manager, to dispose popups after being x. switch (id) { case SpectrumEnums.popUpId.win: displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.win); break; case SpectrumEnums.popUpId.lose: displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.lose); break; case SpectrumEnums.popUpId.custom: displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.custom, "Not enough Ink", "You need to collect all the ink in order to proceed to the next level."); break; default: break; } displayedPopUp.Draw(spriteBatch); }
public void setParent(PopUp parent) { foreach (Button but in buttons) { but.setParentPopUp(parent); } }
public void setParentPopUp(PopUp popUp) { parent = popUp; }
/* * Main Draw Method, decides what needs to be drawn given the current gameState */ public void Draw() { spriteBatch.Begin(); displayedPopUp = null; modelManager.buttonHandler.RemoveAll(); switch (Spectrum.currentGameState) { case SpectrumEnums.GameState.Start: DrawStartScreen(); break; case SpectrumEnums.GameState.MainMenu: resetScore(); DrawMainMenu(); break; case SpectrumEnums.GameState.SettingsMenu: DrawSettingsMenu(); break; case SpectrumEnums.GameState.LevelSelection: DrawActSelection(); break; case SpectrumEnums.GameState.LoadLevel: modelManager.unloadLevel(); DrawLevel(); Spectrum.currentGameState = SpectrumEnums.GameState.InGame; break; case SpectrumEnums.GameState.InGame: DrawInGameHUD(); if (Spectrum.isGameInterrupted) { DisplayPopUp(currentPopUpId); } break; case SpectrumEnums.GameState.GameOver: DrawEndScreen(); break; } modelManager.buttonHandler.Draw(spriteBatch); spriteBatch.End(); graphics.BlendState = BlendState.Opaque; graphics.DepthStencilState = DepthStencilState.Default; graphics.SamplerStates[0] = SamplerState.LinearWrap; }
/* *Draws the Settings menu */ protected void DrawSettingsMenu() { displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.settingsMenu); displayedPopUp.Draw(spriteBatch); }
/* * Draws the Act and Level Selection menu */ protected void DrawActSelection() { displayedPopUp = new PopUp(game, this, player, SpectrumEnums.popUpId.levelSelection); displayedPopUp.Draw(spriteBatch); }
/* * Main Draw Method, decides what needs to be drawn given the current gameState */ public void Draw() { displayedPopUp = null; modelManager.buttonHandler.RemoveAll(); switch (Spectrum.currentGameState) { case SpectrumEnums.GameState.Start: DrawStartScreen(); break; case SpectrumEnums.GameState.MainMenu: resetScore(); DrawMainMenu(); break; case SpectrumEnums.GameState.SettingsMenu: DrawSettingsMenu(); if (Spectrum.isGameInterrupted) { DisplayPopUp(currentPopUpId); } break; case SpectrumEnums.GameState.LevelSelection: DrawActSelection(); break; case SpectrumEnums.GameState.LoadLevel: modelManager.unloadLevel(); DrawLevel(); Spectrum.currentGameState = SpectrumEnums.GameState.InGame; break; case SpectrumEnums.GameState.InGame: DrawInGameHUD(); if (Spectrum.isGameInterrupted) { DisplayPopUp(currentPopUpId); } justDied = false; break; case SpectrumEnums.GameState.GameOver: DrawEndScreen(); break; } modelManager.buttonHandler.Draw(spriteBatch); }