protected void LoadContent() { LoadGameElement(); ChooseStorageDevice(); LoadSettings(); this.SettingsFile.LaunchNumber++; SaveSettings(); LoadScore(); LoadScreen(GameObject.StartScreen); screenPause = new ScreenEngine(this, GameObject.PauseScreen); screenLoading = new ScreenEngine(this, "ScreenLoading.xml"); while (!this.ScreenEngine.IsInitialized) { DoEvents(); System.Threading.Thread.Sleep(100); } #if IPHONE //Lunohod.Program.FinishShowingSplash(); #endif }
public void CloseCurrentScreen() { ScreenEngine screenEngine = DismissCurrentScreen(); screenEngine.Unload(); GC.Collect(); }
public void LoadScreen(string fileName) { #if IPHONE //MonoTouch.UIKit.UIApplication.SharedApplication.BeginIgnoringInteractionEvents(); #endif var newScreenEngine = new ScreenEngine(this, fileName); ActivateScreen(newScreenEngine); }
void ActivateScreen(ScreenEngine newScreenEngine, bool initialize = true) { newScreenEngine.Owner = this.ScreenEngine; lock (this.screenEngines) { screenEngines.Add(newScreenEngine); this.EnqueueEvent(new GameEvent(GameEventType.ScreenActivated, this.CurrentUpdateTime ?? new GameTime(), true)); } if (initialize) { newScreenEngine.Initialize(); } ResetControllers(); GC.Collect(); }