public override void HandleInput(IInputStateSnapshot snapshot) { base.HandleInput(snapshot); if (InputStateTracker.IsMouseButtonPushed()) { HandleMouseButtonPushed(); } if (InputStateTracker.IsMouseButtonReleased()) { HandleMouseButtonReleased(); } if (InputStateTracker.IsMouseButtonDown() && InputStateTracker.IsMouseMove()) { HandleDrag(); } else if (InputStateTracker.IsMouseMove()) { HandleMouseMove(); } if (InputStateTracker.FrameSnapshot.WheelDelta != 0) { HandleWheelDelta(); } }
protected virtual bool PerformMovement() { var dx = (InputStateTracker.MousePosition?.X - InputStateTracker.LastMousePosition?.X) / InputStateTracker.FrameSnapshot.WindowWidth; var dy = (InputStateTracker.MousePosition?.Y - InputStateTracker.LastMousePosition?.Y) / InputStateTracker.FrameSnapshot.WindowHeight; if (dx == 0 && dy == 0) { return(false); } if (InputStateTracker.GetMouseButton(MouseButton.Left)) { return(PerformMovementLeftMouseButton(dx.Value, dy.Value)); } return(true); }