/// <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);
        }
Beispiel #2
0
        public NarrationEffect(string text, ScreenManager manager)
        {
            mNarrator = manager.GetScreens().OfType<GameplayScreen>().First().Narrator;
            mNarrator.Volume = (manager.Game as HalfCakedGame).CurrentProfile.Audio.NarrationVolume * (manager.Game as HalfCakedGame).CurrentProfile.Audio.MasterVolume / 100;
            mNarrator.Rate = 1;

            mWords = text.Split(' ').Select( x => x + " " ).ToArray();
            mFont = manager.Font;

            mBackground = manager.Game.Content.Load<Texture2D>(@"UI\NarrationBackground");
            mNarrationImage = manager.Game.Content.Load<Texture2D>(@"UI\Narrator");

            var size = manager.GraphicsDevice.Viewport.Bounds;
            mRectOut = new Rectangle(size.Width/8, 10, size.Width * 3 / 4, mNarrationImage.Height + 20);

            mTextXStart = mRectOut.X + mNarrationImage.Width + 30;
        }