/// <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)); }
public override void UpdateInput(InputState input) { _controls.ForEach(a => a.UpdateInput(input)); }
public virtual void UpdateInput(InputState input) { }
/// <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); } }
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; } } }
public override void UpdateInput(InputState input) { }
/// <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) { }