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 Vector2DReturns the lastMouseWheelEventthat was received.booleanisMouseDragged(MouseButton mouseButton) Checks if aMouseButtonis being dragged or not.booleanisMousePressed(MouseButton mouseButton) Checks if aMouseButtonis pressed or not.voidonMouseMoved(MouseEvent mouseEvent) Called on move of the mouse.voidonMousePressed(MouseEvent mouseEvent) Called on press of a mouse button.voidonMouseReleased(MouseEvent mouseEvent) Called on release of a mouse button.voidonMouseWheel(MouseWheelEvent mouseWheelEvent) Captures the lastMouseWheelEventthat happened.voidCalled 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 aMouseButtonis pressed or not.- Parameters:
mouseButton- the button to check- Returns:
- true if mouse button is pressed
-
isMouseDragged
Checks if aMouseButtonis 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 lastMouseWheelEventthat was received. Defaults toMouseWheelEvent.NONEif 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 lastMouseWheelEventthat happened.- Parameters:
mouseWheelEvent- the last mouse wheel event that happened
-