Package input
Class Mouse
java.lang.Object
input.Mouse
-
Field Summary
Modifier and TypeFieldDescriptionstatic org.joml.Vector2f
Position of the mousestatic boolean[]
Array for storing states for mouse buttonsstatic boolean
Is the mouse being draggedstatic org.joml.Vector2f
Mouse Scrolling Valuesstatic long
X Position of the mousestatic long
Y Position of the mousestatic org.joml.Vector2f
Position of the mouse on the previous framestatic long
X Position of the mouse on the previous framestatic long
Y Position of the mouse on the previous framestatic float
Mouse Scrolling in X-axis.static float
Mouse Scrolling in Y-axis. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Clear the mouse statestatic boolean
mouseButtonDown
(int button) Get if the queried button is pressedstatic void
Apply the latest changes to the mouseButton arraystatic void
Subscribes to mouse scroll event and mouse button eventstatic void
update()
Called each frame to update mouse button states and mouse position.
-
Field Details
-
mouse
public static org.joml.Vector2f mousePosition of the mouse -
mouseX
public static long mouseXX Position of the mouse -
mouseY
public static long mouseYY Position of the mouse -
pmouse
public static org.joml.Vector2f pmousePosition of the mouse on the previous frame -
pmouseX
public static long pmouseXX Position of the mouse on the previous frame -
pmouseY
public static long pmouseYY Position of the mouse on the previous frame -
mouseScroll
public static org.joml.Vector2f mouseScrollMouse Scrolling Values -
scrollX
public static float scrollXMouse Scrolling in X-axis. -
scrollY
public static float scrollYMouse Scrolling in Y-axis. -
mouseButton
public static boolean[] mouseButtonArray for storing states for mouse buttons -
mouseDragged
public static boolean mouseDraggedIs the mouse being dragged
-
-
Constructor Details
-
Mouse
public Mouse()
-
-
Method Details
-
pollMouseButtons
public static void pollMouseButtons()Apply the latest changes to the mouseButton array -
setupCallbacks
public static void setupCallbacks()Subscribes to mouse scroll event and mouse button event -
update
public static void update()Called each frame to update mouse button states and mouse position. -
mouseButtonDown
public static boolean mouseButtonDown(int button) Get if the queried button is pressed- Parameters:
button
- The button. Check input/Buttons.java- Returns:
- Returns whether the button is currently pressed.
-
clearMouseInput
public static void clearMouseInput()Clear the mouse state
-