Class RegionConstants

java.lang.Object
com.trevlar.menukit.api.panel.RegionConstants

public final class RegionConstants extends Object
The region layout constants, stacking gaps and edge insets, in one place. Both region vocabularies (OutsideRegion, InsideRegion) and the resolver, RegionMath, read them; RegionMath.Insets picks which values each placement context uses. The enums carry no constants of their own.

Two stacking gaps

They stay separate because merging them would move either the menu, anchor and HUD layouts (to 4) or the vanilla-screen layout (to 2).

Edge inset

EDGE_INSET (4) is the screen-edge inset for the HUD and vanilla-screen contexts, matching vanilla's F3 debug overlay. The menu and anchor contexts place against a frame or box rather than a screen edge, so they have no edge inset.
  • Field Details

    • SCREEN_STACK_GAP

      public static final int SCREEN_STACK_GAP
      Stacking gap (GUI-scaled pixels) for vanilla screens that are not containers.
      See Also:
    • EDGE_INSET

      public static final int EDGE_INSET
      Screen-edge inset (GUI-scaled pixels) for the HUD and vanilla-screen contexts, matching vanilla's F3 debug overlay.
      See Also:
    • CENTER_CROSSHAIR_CLEARANCE

      public static final int CENTER_CROSSHAIR_CLEARANCE
      Extra downward offset for InsideRegion.CENTER on the HUD, so a centered HUD panel clears the crosshair.

      HUD only: on a screen, CENTER resolves to the true center. Since InsideRegion serves both contexts, a value for one of them lives here rather than on the enum.

      See Also:
    • SCREEN_EDGE_MARGIN

      public static final int SCREEN_EDGE_MARGIN
      Safe margin (GUI-scaled pixels) from each screen edge. Every panel keeps at least this far from the window's edges; when a panel's natural content would cross it, the panel wraps instead of overflowing (Panel.setAvailableContentWidth(int)).

      A little more than EDGE_INSET, so an adaptive panel doesn't sit flush against the window edge. The two differ on purpose: EDGE_INSET positions edge-anchored panels, while SCREEN_EDGE_MARGIN is the boundary every panel's width budget is measured against.

      See Also: