private ScreenManager() { Dimensions = new Vector2(639, 480); //640 currentScreen = new SplashScreen(); xmlGameScreenManager = new XmlManager<GameScreen>(); xmlGameScreenManager.Type = currentScreen.Type; currentScreen = xmlGameScreenManager.Load("Content/SplashScreen.xml"); }
void Transition(GameTime gameTime) { if (IsTransitioning) { /**In ChangeScreen function Alpha get sets to zero. Then Image update will * will increase it upwards */ Image.Update(gameTime); if (Image.Alpha == 1.0f) { currentScreen.UnloadContent(); currentScreen = newScreen; xmlGameScreenManager.Type = currentScreen.Type; if (File.Exists(currentScreen.XmlPath))//If this path exists currentScreen = xmlGameScreenManager.Load(currentScreen.XmlPath); currentScreen.LoadContent(); } else if (Image.Alpha == 0.0f) { Image.IsActive = false; IsTransitioning = false; } } }