Enum Class MKHudAnchor
- All Implemented Interfaces:
Serializable, Comparable<MKHudAnchor>, Constable
Legacy positioning enum.
HudRegion is the intended primary HUD
positioning system — it carries auto-stacking, priority(...),
fail-loud overflow, and is shared by HUD panels + notifications +
vanilla-screen panels through RegionMath.resolveHud. MKHudAnchor
predates HudRegion and is retained as the raw-anchor fallback for
MKHudPanel/MKHudNotification. Prefer HudRegion for new
code; reach for MKHudAnchor only for the vertical-center positions
(CENTER_LEFT/CENTER_RIGHT) or a one-off raw offset.
Each position anchors the panel to a screen edge or corner.
Offsets move the panel inward from the anchor point:
positive X = right, positive Y = down. For right/bottom anchors,
use negative offsets to move inward (e.g., BOTTOM_RIGHT, -4, -24).
Part of the MenuKit framework.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionint[]resolve(int screenW, int screenH, int panelW, int panelH, int offsetX, int offsetY) Resolves this anchor + offset to absolute screen coordinates.static MKHudAnchorReturns the enum constant of this class with the specified name.static MKHudAnchor[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
TOP_LEFT
-
TOP_CENTER
-
TOP_RIGHT
-
CENTER_LEFT
-
CENTER
-
CENTER_RIGHT
-
BOTTOM_LEFT
-
BOTTOM_CENTER
-
BOTTOM_RIGHT
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
resolve
public int[] resolve(int screenW, int screenH, int panelW, int panelH, int offsetX, int offsetY) Resolves this anchor + offset to absolute screen coordinates.- Parameters:
screenW- GUI-scaled screen widthscreenH- GUI-scaled screen heightpanelW- the panel's computed widthpanelH- the panel's computed heightoffsetX- X offset from anchor (positive = right)offsetY- Y offset from anchor (positive = down)- Returns:
- int[]{x, y} absolute screen position
-