/// <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();
        }
예제 #2
0
        /// <summary>
        /// Release graphics data.
        /// </summary>
        public override void UnloadContent()
        {
            if (starfield != null)
            {
                starfield.UnloadContent();
                starfield = null;
            }

            base.UnloadContent();
        }
예제 #3
0
 /// <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 (starfield != null)
             {
                 starfield.Dispose();
                 starfield = null;
             }
         }
     }
 }
예제 #4
0
        /// <summary>
        /// Loads graphics content for this screen. The background texture is quite
        /// big, so we use our own local ContentManager to load it. This allows us
        /// to unload before going from the menus into the game itself, wheras if we
        /// used the shared ContentManager provided by the ScreenManager, the content
        /// would remain loaded forever.
        /// </summary>
        public override void LoadContent()
        {
            // load the title texture
            titleTexture = ScreenManager.Content.Load <Texture2D>("Textures/title");
            movement     = 0f;

            starfield = new Starfield(
                Vector2.Multiply(new Vector2(
                                     (float)Math.Cos(movement / starsParallaxPeriod),
                                     (float)Math.Sin(movement / starsParallaxPeriod)),
                                 starsParallaxAmplitude),
                ScreenManager.GraphicsDevice, ScreenManager.Content);
            starfield.LoadContent();

            base.LoadContent();
        }
 /// <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;
             }
         }
     }
 }
예제 #6
0
        /// <summary>
        /// Loads graphics content for this screen. The background texture is quite
        /// big, so we use our own local ContentManager to load it. This allows us
        /// to unload before going from the menus into the game itself, wheras if we
        /// used the shared ContentManager provided by the ScreenManager, the content
        /// would remain loaded forever.
        /// </summary>
        public override void LoadContent()
        {
            // load the title texture
            titleTexture = ScreenManager.Content.Load<Texture2D>("Textures/title");
            movement = 0f;

            starfield = new Starfield(
                Vector2.Multiply(new Vector2(
                    (float)Math.Cos(movement / starsParallaxPeriod),
                    (float)Math.Sin(movement / starsParallaxPeriod)),
                    starsParallaxAmplitude), 
                ScreenManager.GraphicsDevice, ScreenManager.Content);
            starfield.LoadContent();

            base.LoadContent();
        }
예제 #7
0
 /// <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 (starfield != null)
             {
                 starfield.Dispose();
                 starfield = null;
             }
         }
     }
 }
예제 #8
0
        /// <summary>
        /// Release graphics data.
        /// </summary>
        public override void UnloadContent()
        {
            if (starfield != null)
            {
                starfield.UnloadContent();
                starfield = null;
            }

            base.UnloadContent();
        }
예제 #9
0
 /// <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;
             }
         }
     }
 }
예제 #10
0
        /// <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();
        }