/// <summary> /// Activates the loading screen. /// </summary> public static new void Load(ScreenManager screenManager, bool loadingIsSlow, 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. var loadingScreen = new InformativeLoadingScreen(loadingIsSlow, screensToLoad); screenManager.AddScreen(loadingScreen); }
/// <summary> /// Activates the loading screen. /// </summary> public static void Load(ScreenManager screenManager, bool loadingIsSlow, 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. var loadingScreen = new LoadingScreen(loadingIsSlow, screensToLoad); screenManager.AddScreen(loadingScreen); InvokeScreenLoaded(new ScreenLoadedEventArgs(screensToLoad[0])); }
protected override void Initialize() { Items.Initialize(Content); GameState gameState = TestData.CreateDefaultGameState(this); Services.AddService(gameState); // Inventory Services.AddService(gameState.Inventory); var inventoryMappingService = new InventoryMappingService(); Services.AddService(inventoryMappingService); InputManager.Initialize(); Fonts.Initialize(this); SoundManager.Initialize(this); var twitter = TwitterProxy.From(TwitterSettingsFile); twitter.Initialize(); Services.AddService(typeof(ITwitter), twitter); Exiting += (o, e) => twitter.SaveTo(TwitterSettingsFile); _spriteBatch = new SpriteBatch(GraphicsDevice); Services.AddService(typeof (SpriteBatch), _spriteBatch); var screenManager = new ScreenManager(this); Components.Add(screenManager); var menuBackgroundComponent = new MenuBackgroundComponent(this, screenManager); menuBackgroundComponent.DrawOrder = -1; Components.Add(menuBackgroundComponent); InitActions(); base.Initialize(); LoadingScreen.Load(screenManager, false, new MainMenuScreen()); }
public MenuBackgroundComponent(Game game, ScreenManager screenManager) : base(game) { _screenManager = screenManager; }
public GameOverScript(Game game) { _screenManager = game.Services.GetService<ScreenManager>(); _rhythmEngine = game.Services.GetService<RhythmEngine>(); }