示例#1
0
        /// <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);
        }
示例#2
0
        /// <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]));
        }
示例#3
0
        protected override void Initialize()
        {
            Items.Initialize(Content);
            AdGameComponent.Initialize(this, ApplicationId);
            Components.Add(AdGameComponent.Current);
            GameState gameState = TestData.CreateDefaultGameState(this);
            Services.AddService(gameState);

            // Inventory
            Services.AddService(gameState.Inventory);

            var cache = new GameCache();
            Services.AddService(cache);

            var inventoryMappingService = new InventoryMappingService();
            Services.AddService(inventoryMappingService);

            InputManager.Initialize();
            Fonts.Initialize(this);
            SoundManager.Initialize(this);

            _spriteBatch = new SpriteBatch(GraphicsDevice);
            Services.AddService(typeof (SpriteBatch), _spriteBatch);

            _screenManager = new ScreenManager(this);
            Components.Add(_screenManager);
            Services.AddService(typeof(ScreenManager), _screenManager);

            var menuBackgroundComponent = new MenuBackgroundComponent(this, _screenManager);
            menuBackgroundComponent.DrawOrder = -1;
            Components.Add(menuBackgroundComponent);

            base.Initialize();
            LoadingScreen.Load(_screenManager, false, new AlternativeMenuScreen());
        }
示例#4
0
 public MenuBackgroundComponent(Game game, ScreenManager screenManager)
     : base(game)
 {
     _screenManager = screenManager;
 }
示例#5
0
 public GameOverScript(Game game)
 {
     _screenManager = game.Services.GetService<ScreenManager>();
     _rhythmEngine = game.Services.GetService<RhythmEngine>();
 }