public void Update(GameTime gameTime, Camera cam) { FadePosition = cam.Position; if (IsScreenChanging == true) { if (Alpha != 1) { Alpha += SpeedOfTransition; } } if (Alpha >= 0.9f) { if (ChangeBack == false) { if (KeepContent == false) { ScreenManager.Instance().CurrentGameScreen.UnloadContent(); Content.Unload(); } NewGameScreen.LoadContent(ref Content); ScreenManager.Instance().CurrentGameScreen = NewGameScreen; Alpha = 0.0f; IsScreenChanging = false; } else { if (KeepContent == false) { ScreenManager.Instance().CurrentGameScreen.UnloadContent(); Content.Unload(); } ScreenManager.Instance().CurrentGameScreen = NewGameScreen; Alpha = 0.0f; IsScreenChanging = false; } } }
public void LoadContent(ContentManager content) { this.Content = new ContentManager(content.ServiceProvider, "Content"); ScreenChange = new GameScreenTransition(content.Load <Texture2D>("FadeImage"), content); CurrentGameScreen.LoadContent(ref content); }