Exemplo n.º 1
0
        protected override void OnFocusChanged(bool gainFocus, FocusSearchDirection direction, Rect previouslyFocusedRect)
        {
            base.OnFocusChanged(gainFocus, direction, previouslyFocusedRect);

            if (gainFocus)
            {
                _game.Resume();
            }
            else
            {
                _game.Pause();
            }
        }
Exemplo n.º 2
0
        protected override void OnFocusedChanged(EventArgs e)
        {
            base.OnFocusedChanged(e);

            if (Focused)
            {
                _game.InputDevice.Update();
                _game.Resume();
                _isPaused = false;
            }
            else
            {
                _isPaused = true;
                _game.Pause();
            }
        }