Example #1
0
        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
        }
Example #2
0
        public void CloseCurrentScreen()
        {
            ScreenEngine screenEngine = DismissCurrentScreen();

            screenEngine.Unload();

            GC.Collect();
        }
Example #3
0
        public void LoadScreen(string fileName)
        {
#if IPHONE
            //MonoTouch.UIKit.UIApplication.SharedApplication.BeginIgnoringInteractionEvents();
#endif
            var newScreenEngine = new ScreenEngine(this, fileName);

            ActivateScreen(newScreenEngine);
        }
Example #4
0
        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();
        }