Class Zones

java.lang.Object
dev.boze.api.gui.util.Zones

public final class Zones extends Object
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 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

      public void add(Rect rect, Predicate<GuiMouseEvent> click, GuiCursor cursor)
      Records an area.
      Parameters:
      click - Handles a press inside it; returns false to let the area beneath have it
      cursor - Cursor while hovering it, or null
    • click

      public boolean click(GuiMouseEvent event)
      Returns:
      Whether an area took the press
    • cursorAt

      public GuiCursor cursorAt(double x, double y)
      Returns:
      Cursor of the topmost area under the point, or null