public override void OnRelease(Vector2 pos) { base.OnRelease(pos); for (int i = 0; i < texts.Count; i++) { if (texts[i].text.Contains(pos.X, pos.Y)) { if (texts[i].text.Name == "Resume") { screen.FadeMeOut(); } else if (texts[i].text.Name == "Restart") { screen.FadeMeOut(); for (int j = 0; j < ScreenManager.Get.Screens.Count; j++) { if (ScreenManager.Get.Screens[j] is GameplayScreen) { (ScreenManager.Get.Screens[j] as GameplayScreen).Restart(); AudioManager.PlayOnce("Sounds/Restart"); } } RaiseFlag(Flags.PASSRENDER); } else if (texts[i].text.Name == "Quit") { ExitScreen(); } else if (texts[i].text.Name == "Settings") { Options o = new Options(); o.Initialize(BaseGame.Get.Content); ScreenManager.Get.AddScreen(o); } } texts[i].isSelected = false; } }
public override void ProcessEvent(Event ev) { if (!IsTopScreen) { return; } base.ProcessEvent(ev); if ((ev is MenuEvent)) { if ((ev as MenuEvent).sender is Button && fader == null) { if (((ev as MenuEvent).sender as Button).Text != null) { fader = new BlankNess(); fader.Initialize(Content); fader.fullBlankity = 1.0f; fader.RaiseFlag(Flags.FADE_IN); Components.Add(fader); } else { Options p = new Options(); p.Initialize(Content); ScreenManager.Get.AddScreen(p); } } } }