Class Zones
java.lang.Object
dev.boze.api.gui.util.Zones
Clickable areas recorded while drawing. Clicks are resolved against the areas of the last
finished frame, newest first, so only what was on screen can be clicked and something drawn on
top shields what lies under it.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(Rect rect, Predicate<GuiMouseEvent> click, GuiCursor cursor) Records an area.voidbegin()Starts recording a frame.booleanclick(GuiMouseEvent event) cursorAt(double x, double y) voidend()Ends the frame; its areas take clicks until the next frame ends.
-
Constructor Details
-
Zones
public Zones()
-
-
Method Details
-
begin
public void begin()Starts recording a frame. -
end
public void end()Ends the frame; its areas take clicks until the next frame ends. -
add
Records an area.- Parameters:
click- Handles a press inside it; returns false to let the area beneath have itcursor- Cursor while hovering it, or null
-
click
- Returns:
- Whether an area took the press
-
cursorAt
- Returns:
- Cursor of the topmost area under the point, or null
-