예제 #1
0
        protected override void LoadContent()
        {
            TestImageMap = Content.Load<Texture2D>(@"TestSkin\ImageMap");
            TestMap = File.OpenText(@"GuiExampleContent\TestSkin\Map.txt").ReadToEnd();
            TestSpriteFont = Content.Load<SpriteFont>(@"TestSkin\Font");

            GreyImageMap = Content.Load<Texture2D>(@"GreySkin\ImageMap");
            GreyMap = File.OpenText(@"GuiExampleContent\GreySkin\Map.txt").ReadToEnd();
            GreySpriteFont = Content.Load<SpriteFont>(@"GreySkin\Texture");

            DebugUtils.Init(_graphics.GraphicsDevice, GreySpriteFont);

            _index = 0;
            _currentScreen = _currentScreens[_index];
            _currentScreen.Init(this);
        }
예제 #2
0
        protected override void Update(GameTime gameTime)
        {
            var newState = Keyboard.GetState();

            if (_oldState.IsKeyUp(Keys.Tab) && newState.IsKeyDown(Keys.Tab)) {
                if (_index + 1 == _currentScreens.Length) {
                    _index = 0;
                } else {
                    _index++;
                }

                _currentScreen = _currentScreens[_index];
                _currentScreen.Init(this);
            }

            _currentScreen.Update();

            _oldState = newState;

            base.Update(gameTime);
        }