Package input
Class Mouse
java.lang.Object
input.Mouse
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic org.joml.Vector2fPosition of the mousestatic boolean[]Array for storing states for mouse buttonsstatic booleanIs the mouse being draggedstatic org.joml.Vector2fMouse Scrolling Valuesstatic longX Position of the mousestatic longY Position of the mousestatic org.joml.Vector2fPosition of the mouse on the previous framestatic longX Position of the mouse on the previous framestatic longY Position of the mouse on the previous framestatic floatMouse Scrolling in X-axis.static floatMouse Scrolling in Y-axis. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidClear the mouse statestatic booleanmouseButtonDown(int button) Get if the queried button is pressedstatic voidApply the latest changes to the mouseButton arraystatic voidSubscribes to mouse scroll event and mouse button eventstatic voidupdate()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
-