/// <summary> /// Load graphics content for the game. /// </summary> public override void LoadContent() { // Developers Comment or uncomment the bloomComponent to run with effects or not // *************************** // Comment or uncomment from here // *************************** // create and add the bloom effect #if !BLOOM bloomComponent = new BloomComponent(ScreenManager.Game); bloomComponent.Settings = BloomSettings.PresetSettings[0]; ScreenManager.Game.Components.Add(bloomComponent); bloomComponent.Initialize(); bloomComponent.Visible = false; // we want to control when bloom component is drawn #endif // *************************** // Comment or uncomment to here // *************************** // create the starfield starfield = new Starfield(Vector2.Zero, ScreenManager.GraphicsDevice, ScreenManager.Content); starfield.LoadContent(); // start the background soundtrack AudioManager.PlaySoundTrack(); base.LoadContent(); }
/// <summary> /// Exit this screen. /// </summary> public override void ExitScreen() { if (bloomComponent != null) { bloomComponent.Visible = false; ScreenManager.Game.Components.Remove(bloomComponent); bloomComponent = null; } if (!IsExiting && (networkSession != null)) { networkSession.SessionEnded -= sessionEndedHandler; networkSession.GameEnded -= gameEndedHandler; networkSession.GamerLeft -= gamerLeftHandler; } MediaPlayer.Stop(); base.ExitScreen(); }
/// <summary> /// Disposes this object. /// </summary> /// <param name="disposing"> /// True if this method was called as part of the Dispose method. /// </param> protected virtual void Dispose(bool disposing) { if (disposing) { lock (this) { if (bloomComponent != null) { bloomComponent.Dispose(); bloomComponent = null; } if (starfield != null) { starfield.Dispose(); starfield = null; } } } }
/// <summary> /// Load graphics content for the game. /// </summary> public override void LoadContent() { // Developers Comment or uncomment the bloomComponent to run with effects or not // *************************** // Comment or uncomment from here // *************************** // create and add the bloom effect #if BLOOM bloomComponent = new BloomComponent(ScreenManager.Game); bloomComponent.Settings = BloomSettings.PresetSettings[0]; ScreenManager.Game.Components.Add(bloomComponent); bloomComponent.Initialize(); bloomComponent.Visible = false; // we want to control when bloom component is drawn #endif // *************************** // Comment or uncomment to here // *************************** // create the starfield starfield = new Starfield(Vector2.Zero, ScreenManager.GraphicsDevice, ScreenManager.Content); starfield.LoadContent(); // start the background soundtrack AudioManager.PlaySoundTrack(); base.LoadContent(); }