java.lang.Object
technology.sola.engine.input.MouseInput
MouseInput contains information about user interaction with the mouse.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable Vector2D
Returns the lastMouseWheelEvent
that was received.boolean
isMouseDragged
(MouseButton mouseButton) Checks if aMouseButton
is being dragged or not.boolean
isMousePressed
(MouseButton mouseButton) Checks if aMouseButton
is pressed or not.void
onMouseMoved
(MouseEvent mouseEvent) Called on move of the mouse.void
onMousePressed
(MouseEvent mouseEvent) Called on press of a mouse button.void
onMouseReleased
(MouseEvent mouseEvent) Called on release of a mouse button.void
onMouseWheel
(MouseWheelEvent mouseWheelEvent) Captures the lastMouseWheelEvent
that happened.void
Called once per frame to update the current status of the mouse based on the user's interaction.
-
Constructor Details
-
MouseInput
public MouseInput()
-
-
Method Details
-
isMousePressed
Checks if aMouseButton
is pressed or not.- Parameters:
mouseButton
- the button to check- Returns:
- true if mouse button is pressed
-
isMouseDragged
Checks if aMouseButton
is being dragged or not.- Parameters:
mouseButton
- the button to check- Returns:
- true if mouse button is being dragged
-
getMousePosition
- Returns:
- the current position of the mouse on screen
-
getMouseWheel
Returns the lastMouseWheelEvent
that was received. Defaults toMouseWheelEvent.NONE
if there was no mouse wheel event this frame.- Returns:
- the last mouse wheel event
-
updateStatusOfMouse
public void updateStatusOfMouse()Called once per frame to update the current status of the mouse based on the user's interaction. -
onMouseMoved
Called on move of the mouse.- Parameters:
mouseEvent
- theMouseEvent
-
onMousePressed
Called on press of a mouse button.- Parameters:
mouseEvent
- theMouseEvent
-
onMouseReleased
Called on release of a mouse button.- Parameters:
mouseEvent
- theMouseEvent
-
onMouseWheel
Captures the lastMouseWheelEvent
that happened.- Parameters:
mouseWheelEvent
- the last mouse wheel event that happened
-