public void ChangeScreen(IGameScreen screen)
        {
            RemoveAllScreens();
            m_gameScreens.Add(screen);

            screen.Init(m_contentManager, m_screenBounds);
        }
        public void ChangeScreen(IGameScreen screen)
        {
            RemoveAllScreens();

            m_gameScreens.Add(screen);

            screen.Init(m_contentManager);
        }
Example #3
0
        public void ChangeScreen(IGameScreen screen)
        {
            Stopped = true;

            GameScreen = screen;
            GameScreen.Init(this.Content);

            Stopped = false;
        }
Example #4
0
        public void Init(ContentManager content, SpriteBatch spriteBatch, GraphicsDeviceManager graphics, Game game)
        {
            this.GraphicsSettings     = new GraphicsSettings();
            GraphicsSettings.Vignette = true;
            this.Stopped               = false;
            this.ThisGame              = game;
            this.Content               = content;
            this.SpriteBatch           = spriteBatch;
            this.GraphicsDeviceManager = graphics;

            // load essential assets and sounds.
            GlobalAssets.SoundEffects.Add("torch", Content.Load <SoundEffect>("sound/torch"));
            GlobalAssets.SoundEffects.Add("doorOpen", Content.Load <SoundEffect>("sound/door_open"));
            GlobalAssets.SoundEffects.Add("doorClose", Content.Load <SoundEffect>("sound/door_close"));
            GlobalAssets.Arial12 = Content.Load <SpriteFont>("arial12");
            GlobalAssets.Arial24 = Content.Load <SpriteFont>("arial24");
            GlobalAssets.Arial18 = Content.Load <SpriteFont>("arial18");
            GlobalAssets.Arsenal = Content.Load <SpriteFont>("Arsenal");
            Black            = Content.Load <Texture2D>("black");
            pausedMenuTitle  = Content.Load <Texture2D>("invTitle");
            controllerCursor = Content.Load <Texture2D>("ui/controller_mouse");
            GlobalAssets.SpeechDialogTexture = Content.Load <Texture2D>("ui/speech_dialog");

            GameScreen = new SGame.Screens.MenuGameScreen();
            GameScreen.Init(this.Content);

            GameManager.Game.ConsoleInterpreter.RegisterCommand("fullscreen", (o) =>
            {
                try
                {
                    GraphicsDeviceManager.IsFullScreen = bool.Parse(o[0]);
                    GraphicsDeviceManager.ApplyChanges();
                    return("Set fullscreen mode to " + o[0]);
                }
                catch
                {
                    return(o[0] + " is not a valid input.");
                }
            });
            GameManager.Game.ConsoleInterpreter.RegisterCommand("res", (o) =>
            {
                try
                {
                    GraphicsDeviceManager.PreferredBackBufferWidth  = int.Parse(o[0]);
                    GraphicsDeviceManager.PreferredBackBufferHeight = int.Parse(o[1]);
                    GraphicsDeviceManager.ApplyChanges();
                    return("Set res to " + o[0] + "x" + o[1]);
                }
                catch
                {
                    return("Not a valid input.");
                }
            });

            this.ControllerCursorPos = ScreenSize / 2;
        }
Example #5
0
        public void PushScreen(IGameScreen screen)
        {
            if (!IsScreenListEmpty)
            {
                var currentScreen = GetCurrentSreen();
                currentScreen.Pause();
            }

            _gameScreens.Add(screen);
            screen.Init(_contentManager);
        }
Example #6
0
 public void ChangeScreen(IGameScreen screen)
 {
     if (_screenToDisplay == null)
     {
         _transitionState = TransitionState.FadeIn;
     }
     _screenToDisplay = screen;
     if (_transitionState == TransitionState.Hidden)
     {
         RemoveAllScreens();
         _gameScreens.Add(screen);
         screen.Init(_contentManager);
         _transitionState = TransitionState.FadeOut;
         _screenToDisplay = null;
     }
 }
        public void PushScreen(IGameScreen screen)
        {
            if (!IsScreenListEmpty)
            {
                var curScreen = GetCurrentScreen();

                curScreen.Pause();
            }
            m_gameScreens.Add(screen);

            screen.Init(m_contentManager, m_screenBounds);
        }