protected override void Initialize()
        {
            screenManager = new ScreenManager(this);
            this.Components.Add(screenManager);

            screenManager.AddScreen(new BackgroundScreen());
            screenManager.AddScreen(new MainMenuScreen());

            base.Initialize();
        }
        /// <summary>
        /// Activates the loading screen.
        /// </summary>
        public static void Load(ScreenManager screenManager,
            EventHandler<EventArgs> loadNextScreen,
            bool loadingIsSlow)
        {
            // Tell all the current screens to transition off.
            foreach (GameScreen screen in screenManager.GetScreens())
                screen.ExitScreen();

            // Create and activate the loading screen.
            LoadingScreen loadingScreen = new LoadingScreen();

            loadingScreen.loadingIsSlow = loadingIsSlow;
            loadingScreen.loadNextScreen = loadNextScreen;

            screenManager.AddScreen(loadingScreen);
        }
예제 #3
0
 /// <summary>
 /// Loading screen callback for activating the main menu screen,
 /// used when quitting from the game.
 /// </summary>
 void LoadMainMenuScreen(object sender, EventArgs e)
 {
     ScreenManager.AddScreen(new BackgroundScreen());
     ScreenManager.AddScreen(new MainMenuScreen());
 }