Class RegionConstants
java.lang.Object
com.trevlar.menukit.api.panel.RegionConstants
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
MENU_STACK_GAP(2) for the menu, anchor and HUD contexts.SCREEN_STACK_GAP(4) for vanilla screens that are not containers.
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intExtra downward offset forInsideRegion.CENTERon the HUD, so a centered HUD panel clears the crosshair.static final intScreen-edge inset (GUI-scaled pixels) for the HUD and vanilla-screen contexts, matching vanilla's F3 debug overlay.static final intStacking gap (GUI-scaled pixels) for the menu, anchor and HUD contexts.static final intSafe margin (GUI-scaled pixels) from each screen edge.static final intStacking gap (GUI-scaled pixels) for vanilla screens that are not containers. -
Method Summary
-
Field Details
-
MENU_STACK_GAP
public static final int MENU_STACK_GAPStacking gap (GUI-scaled pixels) for the menu, anchor and HUD contexts.- See Also:
-
SCREEN_STACK_GAP
public static final int SCREEN_STACK_GAPStacking gap (GUI-scaled pixels) for vanilla screens that are not containers.- See Also:
-
EDGE_INSET
public static final int EDGE_INSETScreen-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_CLEARANCEExtra downward offset forInsideRegion.CENTERon the HUD, so a centered HUD panel clears the crosshair.HUD only: on a screen,
CENTERresolves to the true center. SinceInsideRegionserves 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_MARGINSafe 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_INSETpositions edge-anchored panels, whileSCREEN_EDGE_MARGINis the boundary every panel's width budget is measured against.- See Also:
-