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

            screenEngine.Unload();

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

            ActivateScreen(newScreenEngine);
        }
예제 #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();
        }