public Game1() { Content.RootDirectory = "Content"; graphics = new GraphicsDeviceManager(this); //this.TargetElapsedTime = TimeSpan.FromSeconds(1.0f / 54f); #if WINDOWS_PHONE graphics.PreferredBackBufferWidth = 800; graphics.PreferredBackBufferHeight = 480; #endif #if XBOX || WINDOWS graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 720; #endif graphics.PreferMultiSampling = true; parameters.MultiSampleCount = 16; graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings); graphics.ApplyChanges(); // Create the screen manager component. screenManager = new ScreenManager(this); Camera.ViewportWidth = graphics.PreferredBackBufferWidth; Camera.ViewportHeight = graphics.PreferredBackBufferHeight; Camera.SetScreenRectangle(); Components.Add(screenManager); // Activate the first screens. screenManager.AddScreen(new BackgroundScreen(), null); screenManager.AddScreen(new PressStartScreen(), null); //Guide.SimulateTrialMode = false; }
/// <summary> /// Activates the loading screen. /// </summary> public static void Load(ScreenManager screenManager, bool loadingIsSlow, PlayerIndex? controllingPlayer, params GameScreen[] screensToLoad) { // Tell all the current screens to transition off. foreach (GameScreen screen in screenManager.GetScreens()) screen.ExitScreen(); // Create and activate the loading screen. LoadingScreen loadingScreen = new LoadingScreen(screenManager, loadingIsSlow, screensToLoad); screenManager.AddScreen(loadingScreen, controllingPlayer); }