public class HoverChecker
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
bottom |
private GuiButton |
button |
private long |
hoverStart |
private int |
left |
private int |
right |
private int |
threshold |
private int |
top |
Constructor and Description |
---|
HoverChecker(GuiButton button,
int threshold) |
HoverChecker(int top,
int bottom,
int left,
int right,
int threshold) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkHover(int mouseX,
int mouseY)
Checks if the mouse is in the hover region.
|
boolean |
checkHover(int mouseX,
int mouseY,
boolean canHover)
Checks if the mouse is in the hover region.
|
void |
resetHoverTimer()
Manually resets the hover timer.
|
void |
updateBounds(int top,
int bottom,
int left,
int right)
Call this method if the intended region has changed such as if the region must follow a scrolling list.
|
private int top
private int bottom
private int left
private int right
private int threshold
private GuiButton button
private long hoverStart
public HoverChecker(int top, int bottom, int left, int right, int threshold)
public HoverChecker(GuiButton button, int threshold)
public void updateBounds(int top, int bottom, int left, int right)
public boolean checkHover(int mouseX, int mouseY)
public boolean checkHover(int mouseX, int mouseY, boolean canHover)
public void resetHoverTimer()