/// <summary>
        /// The constructor is private: loading screens should
        /// be activated via the static Load method instead.
        /// </summary>
        private LoadingScreen(ScreenManager screenManager, bool loadingIsSlow,
            Screen[] screensToLoad)
        {
            this.loadingIsSlow = loadingIsSlow;
            this.screensToLoad = screensToLoad;

            TransitionOnTime = TimeSpan.FromSeconds(0.5);
        }
        /// <summary>
        /// Activates the loading screen.
        /// </summary>
        public static void Load(ScreenManager screenManager, bool loadingIsSlow,
            PlayerIndex? controllingPlayer,
            params Screen[] screensToLoad)
        {
            // Tell all the current screens to transition off.

            foreach (Screen screen in screenManager.GetScreens())
                screen.ExitScreen();
            // Create and activate the loading screen.
            LoadingScreen loadingScreen = new LoadingScreen(screenManager,
                                                            loadingIsSlow,
                                                            screensToLoad);

            screenManager.AddScreen(loadingScreen, controllingPlayer,0);
        }
Esempio n. 3
0
 public Main()
 {
     graphics = new GraphicsDeviceManager(this);
     content = new ContentManager(Services);
     screenManager = new ScreenManager(this);
     gameManager = new GameManager();
     diagonsticManager = new DiagnosticManager(this);
     this.Components.Add(screenManager);
     this.Components.Add(diagonsticManager);
     graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs>(LoadFullResolution);
     Content.RootDirectory = "Content";
     numGenerator = new Random();
     bloodStains = new List<Texture2D>();
     stars = new List<Texture2D>();
     clouds = new List<Texture2D>();
     sprites = new Dictionary<string, Texture2D>();
     normals = new Dictionary<string, Texture2D>();
     speculars = new Dictionary<string, Texture2D>();
     animatedSprites = new Dictionary<string, Animation2D>();
     killSounds = new List<SoundEffect>();
     backgroundSounds = new List<SoundEffect>();
     backgroundLoops = new List<SoundEffectInstance>();
 }