Package me.hackware.api.hud
Class VanillaHUDElement
java.lang.Object
me.hackware.api.hud.HUDElement
me.hackware.api.hud.VanillaHUDElement
- All Implemented Interfaces:
SettingContainer
Base for phantom elements that proxy vanilla (or third-party) HUD clusters —
hotbar, boss bar, Xaero minimap. They only position/scale rendering that
happens elsewhere: draggable in the editor, offset the real renderer in-world.
-
Nested Class Summary
Nested classes/interfaces inherited from class me.hackware.api.hud.HUDElement
HUDElement.Anchor, HUDElement.ConditionType, HUDElement.ExpandAnchorX, HUDElement.ExpandAnchorY, HUDElement.VisibilityCondition, HUDElement.VisibilityKeyMode -
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedVanillaHUDElement(String id, int defaultX, int defaultY, HUDElement.Anchor anchor) -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether this element supports the "Reset to default" context-menu action.voidclamp(int screenWidth, int screenHeight) Clamp position to screen bounds, respecting screen margin and per-side flags.booleanWhether this element scales with the global HUD text scale.floatScale to pass to the sharedHUDElement.render(net.minecraft.client.gui.GuiGraphics, net.minecraft.client.gui.Font)wrapper.Methods inherited from class me.hackware.api.hud.HUDElement
addCondition, addSettings, addSettings, areConditionsMet, clearExpandOverrides, clearSavedPosition, contains, defaultTextColor, effHeight, effRenderScale, effWidth, getConditions, getEditorAlpha, getHeight, getId, getReservedHeight, getReservedWidth, getScale, getSettings, getVisibilityKey, getVisibilityKeyMode, getWidth, getX, getY, graphicalScale, hudScale, isDraggable, isEditorHidden, isVisibilityHoldShows, loadElementSettings, migrateArgbColorKey, migrateColorSettingKey, migrateEnumSettingKey, migrateOpacityIntoColorAlpha, migrateOverrideColorKey, migrateSettingKey, migrateSettingKey, removeCondition, render, render, renderContent, renderEditor, renderEditor, resetClampSides, resetToDefault, resolve, resolvedExpandX, resolvedExpandY, resolveEditor, saveConditions, saveContainerSettings, savePosition, saveVisibilityKey, setClampSides, setEditorAlpha, setExpandAnchorX, setExpandAnchorY, setExpandOverrides, setPosition, setScale, setVisibilityHoldShows, setVisibilityKey, setVisibilityKeyMode, snapshotAnchor, updateEditorSize, updateSize, usesBaseScaleSlider
-
Constructor Details
-
VanillaHUDElement
-
-
Method Details
-
scalesWithTextScale
public boolean scalesWithTextScale()Description copied from class:HUDElementWhether this element scales with the global HUD text scale. Text-based elements returntrue; graphical elements (hotbar, item, icons, bars, models, maps) override this tofalseso the text scale only affects text and they keep their own per-element scale.- Overrides:
scalesWithTextScalein classHUDElement
-
wrapperScale
public float wrapperScale()Description copied from class:HUDElementScale to pass to the sharedHUDElement.render(net.minecraft.client.gui.GuiGraphics, net.minecraft.client.gui.Font)wrapper. Most graphical elements scale fully through the wrapper, so this returnsHUDElement.graphicalScale()(per-element scale × base HUD scale). Elements that apply their per-element scale internally (item, armor, hotbar, boss bar, minimap) override this — toHudServices.getTextScale()when the wrapper should still apply the base scale on top of their internal per-element scale, or1.0when they apply the full scale themselves.- Overrides:
wrapperScalein classHUDElement
-
getExpandAnchorX
- Overrides:
getExpandAnchorXin classHUDElement
-
getExpandAnchorY
- Overrides:
getExpandAnchorYin classHUDElement
-
canResetToDefault
public boolean canResetToDefault()Description copied from class:HUDElementWhether this element supports the "Reset to default" context-menu action. Subclasses that have a meaningful default position (e.g. built-in HUD elements anchored to vanilla positions) should override and return true.- Overrides:
canResetToDefaultin classHUDElement
-
clamp
public void clamp(int screenWidth, int screenHeight) Description copied from class:HUDElementClamp position to screen bounds, respecting screen margin and per-side flags.- Overrides:
clampin classHUDElement
-