/// <summary> /// Accepts a load request from a screen. Transitions from the screen to the loading screen while loading. /// Transitions back to the original screen after loading is complete /// </summary> /// <param name="screenToLoad">The screen requesting the load operation</param> /// <param name="loadMethod">The method containing the loading logic for the screen</param> /// <param name="loadArgs">All arguments required for the loadMethod</param> public void LoadScreenContent(GameScreen screenToLoad, Delegate loadMethod, params object[] loadArgs) { // Transitions from the loading screen to the original screen Action FinalizeLoad = () => { transitionScreens(loadingScreen, screenToLoad); }; screenToLoad.Hide(); activeScreen = loadingScreen; loadingScreen.LoadScreenContent(loadMethod, FinalizeLoad, loadArgs); loadingScreen.Show(); }
public void transitionAndLoad(GameScreen fromScreen, ActionScreen toScreen) { fromScreen.Hide(); activeScreen = toScreen; toScreen.RequestLoadLevel(); }
public void transitionScreens(GameScreen fromScreen, GameScreen toScreen) { fromScreen.Hide(); activeScreen = toScreen; activeScreen.Show(); }