/// <summary>
        /// Handles input and passes it on to it's controls.
        /// </summary>
        public override void HandleInput(InputState input)
        {
            base.HandleInput(input);

            _controls.ForEach(a=> a.UpdateInput(input));
        }
Esempio n. 2
0
 public override void UpdateInput(InputState input)
 {
     _controls.ForEach(a => a.UpdateInput(input));
 }
Esempio n. 3
0
 public virtual void UpdateInput(InputState input)
 {
 }
Esempio n. 4
0
        /// <summary>
        /// Handles input and passes it on to it's controls.
        /// </summary>
        public override void HandleInput(InputState input)
        {
            base.HandleInput(input);

            _game.Input =
                new Input
                {
                    InputPos = new Vector2(input.MouseState.X, input.MouseState.Y),
                    FirePressed = input.CurrentKeyboardStates[0].IsKeyDown(Keys.Space) ||
                                  input.MouseState.LeftButton == ButtonState.Pressed
                };
            if (input.CurrentKeyboardStates[0].IsKeyDown(Keys.P) &&
                !input.LastKeyboardStates[0].IsKeyDown(Keys.P))
            {
                //_game.TogglePause();
            }

            if (input.CurrentKeyboardStates[0].IsKeyDown(Keys.Escape) &&
                !input.LastKeyboardStates[0].IsKeyDown(Keys.Escape))
            {
                //_game.Stop();
                _game.Dispose();
                ScreenManager.RemoveScreen(this);
                ScreenManager.AddScreen(new GameMenu(), ControllingPlayer);
            }
        }
Esempio n. 5
0
        public override void UpdateInput(InputState input)
        {
            _state = input.MouseState;

            if (Enabled)
            {
                if (ContainsPos(new Vector2(input.MouseState.X, input.MouseState.Y)))
                {
                    if (input.MouseState.LeftButton == ButtonState.Released && Status == ButtonStatus.Down)
                    {
                        if (Clicked != null)
                        {
                            // Fire the clicked event.
                            Clicked(this, EventArgs.Empty);
                        }
                    }
                    else if (input.MouseState.LeftButton == ButtonState.Pressed)
                    {
                        Status = ButtonStatus.Down;
                    }
                }
                else
                {
                    Status = ButtonStatus.Up;
                }
            }
        }
Esempio n. 6
0
 public override void UpdateInput(InputState input)
 {
 }
Esempio n. 7
0
 /// <summary>
 /// Allows the screen to handle user input. Unlike Update, this method
 /// is only called when the screen is active, and not when some other
 /// screen has taken the focus.
 /// </summary>
 public virtual void HandleInput(InputState input)
 {
 }