Package me.hackware.api.hud
Class TextHUDElement
java.lang.Object
me.hackware.api.hud.HUDElement
me.hackware.api.hud.TextHUDElement
- All Implemented Interfaces:
SettingContainer
- Direct Known Subclasses:
TemplateTextHud,TextListHUDElement
Base class for simple single-line text HUD elements.
Subclasses only need to provide
buildText() and getColor().-
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
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected net.minecraft.network.chat.Componentprotected net.minecraft.network.chat.ComponentText the box is measured against.protected abstract StringThe text string to display.protected abstract intgetColor()The ARGB color for the text.protected voidrenderContent(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font font) protected inttextX(net.minecraft.client.gui.Font font, net.minecraft.network.chat.Component text) Where the drawn text starts inside the box.protected voidupdateSize(net.minecraft.client.gui.Font font) Methods inherited from class me.hackware.api.hud.HUDElement
addCondition, addSettings, addSettings, areConditionsMet, canResetToDefault, clamp, clearExpandOverrides, clearSavedPosition, contains, defaultTextColor, effHeight, effRenderScale, effWidth, getConditions, getEditorAlpha, getExpandAnchorX, getExpandAnchorY, 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, renderEditor, renderEditor, resetClampSides, resetToDefault, resolve, resolvedExpandX, resolvedExpandY, resolveEditor, saveConditions, saveContainerSettings, savePosition, saveVisibilityKey, scalesWithTextScale, setClampSides, setEditorAlpha, setExpandAnchorX, setExpandAnchorY, setExpandOverrides, setPosition, setScale, setVisibilityHoldShows, setVisibilityKey, setVisibilityKeyMode, snapshotAnchor, updateEditorSize, usesBaseScaleSlider, wrapperScale
-
Field Details
-
PAD_H
protected static final int PAD_H- See Also:
-
PAD_V
protected static final int PAD_V- See Also:
-
-
Constructor Details
-
TextHUDElement
-
-
Method Details
-
buildText
The text string to display. Called every frame. -
getColor
protected abstract int getColor()The ARGB color for the text. Called every frame. -
buildDisplayText
protected net.minecraft.network.chat.Component buildDisplayText() -
buildSizingText
protected net.minecraft.network.chat.Component buildSizingText()Text the box is measured against. Defaults to what's drawn; elements whose drawn text animates (typewriter) return the full string here so the box doesn't breathe frame to frame. -
updateSize
protected void updateSize(net.minecraft.client.gui.Font font) - Specified by:
updateSizein classHUDElement
-
textX
protected int textX(net.minecraft.client.gui.Font font, net.minecraft.network.chat.Component text) Where the drawn text starts inside the box. Only matters when the drawn text can be narrower than the box the sizing text reserved — see the typewriter inTemplateTextHud, which aligns the partial text to the element's resolved expand anchor. -
renderContent
protected void renderContent(net.minecraft.client.gui.GuiGraphics graphics, net.minecraft.client.gui.Font font) - Specified by:
renderContentin classHUDElement
-