@Environment(value=CLIENT)
public interface Element
Modifier and Type | Method and Description |
---|---|
default boolean |
changeFocus(boolean lookForwards)
Changes the focusing element by cycling to the next/previous element.
|
default boolean |
charTyped(char chr,
int keyCode)
Callback for when a character input has been captured.
|
default boolean |
isMouseOver(double mouseX,
double mouseY)
Checks if the mouse position is within the bound
of the element.
|
default boolean |
keyPressed(int keyCode,
int scanCode,
int modifiers)
Callback for when a key down event has been captured.
|
default boolean |
keyReleased(int keyCode,
int scanCode,
int modifiers)
Callback for when a key down event has been captured.
|
default boolean |
mouseClicked(double mouseX,
double mouseY,
int button)
Callback for when a mouse button down event
has been captured.
|
default boolean |
mouseDragged(double mouseX,
double mouseY,
int button,
double deltaX,
double deltaY)
Callback for when a mouse button drag event
has been captured.
|
default void |
mouseMoved(double mouseX,
double mouseY)
Callback for when a mouse move event has been captured.
|
default boolean |
mouseReleased(double mouseX,
double mouseY,
int button)
Callback for when a mouse button release event
has been captured.
|
default boolean |
mouseScrolled(double mouseX,
double mouseY,
double amount)
Callback for when a mouse button scroll event
has been captured.
|
default void mouseMoved(double mouseX, double mouseY)
mouseX
- the X coordinate of the mousemouseY
- the Y coordinate of the mouseMouse.onCursorPos(long, double, double)
default boolean mouseClicked(double mouseX, double mouseY, int button)
GLFW
class.mouseX
- the X coordinate of the mousemouseY
- the Y coordinate of the mousebutton
- the mouse button numbertrue
to indicate that the event handling is successful/validMouse.onMouseButton(long, int, int, int)
,
GLFW.GLFW_MOUSE_BUTTON_1
default boolean mouseReleased(double mouseX, double mouseY, int button)
GLFW
class.mouseX
- the X coordinate of the mousemouseY
- the Y coordinate of the mousebutton
- the mouse button numbertrue
to indicate that the event handling is successful/validMouse.onMouseButton(long, int, int, int)
,
GLFW.GLFW_MOUSE_BUTTON_1
default boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY)
GLFW
class.mouseX
- the current X coordinate of the mousemouseY
- the current Y coordinate of the mousebutton
- the mouse button numberdeltaX
- the difference of the current X with the previous X coordinatedeltaY
- the difference of the current Y with the previous Y coordinatetrue
to indicate that the event handling is successful/validMouse.onCursorPos(long, double, double)
,
GLFW.GLFW_MOUSE_BUTTON_1
default boolean mouseScrolled(double mouseX, double mouseY, double amount)
mouseX
- the X coordinate of the mousemouseY
- the Y coordinate of the mouseamount
- value is > 1
if scrolled down, < 1
if scrolled uptrue
to indicate that the event handling is successful/validMouse.onMouseScroll(long, double, double)
default boolean keyPressed(int keyCode, int scanCode, int modifiers)
GLFW
class.keyCode
- the named key code of the event as described in the GLFW
classscanCode
- the unique/platform-specific scan code of the keyboard inputmodifiers
- a GLFW bitfield describing the modifier keys that are held down (see GLFW Modifier key flags)true
to indicate that the event handling is successful/validKeyboard.onKey(long, int, int, int, int)
,
GLFW.GLFW_KEY_Q
,
GLFWKeyCallbackI.invoke(long, int, int, int, int)
default boolean keyReleased(int keyCode, int scanCode, int modifiers)
GLFW
class.keyCode
- the named key code of the event as described in the GLFW
classscanCode
- the unique/platform-specific scan code of the keyboard inputmodifiers
- a GLFW bitfield describing the modifier keys that are held down (see GLFW Modifier key flags)true
to indicate that the event handling is successful/validKeyboard.onKey(long, int, int, int, int)
,
GLFW.GLFW_KEY_Q
,
GLFWKeyCallbackI.invoke(long, int, int, int, int)
default boolean charTyped(char chr, int keyCode)
GLFW
class.chr
- the captured characterkeyCode
- the associated key codetrue
to indicate that the event handling is successful/validKeyboard.onChar(long, int, int)
,
GLFW.GLFW_KEY_Q
,
GLFWKeyCallbackI.invoke(long, int, int, int, int)
default boolean changeFocus(boolean lookForwards)
lookForwards
- true
to cycle forwards, otherwise cycle backwardstrue
to indicate that the event handling is successful/validdefault boolean isMouseOver(double mouseX, double mouseY)
mouseX
- the X coordinate of the mousemouseY
- the Y coordinate of the mousetrue
if the mouse is within the bound of the element, otherwise false