Class HudElement
java.lang.Object
org.rusherhack.client.api.ui.ElementBase
org.rusherhack.client.api.ui.ScaledElementBase
org.rusherhack.client.api.feature.hud.HudElement
- All Implemented Interfaces:
IHudElement,Globals,IRenderable2D,org.rusherhack.core.bind.IBindable,org.rusherhack.core.event.listener.EventListener,org.rusherhack.core.feature.IFeature,org.rusherhack.core.feature.IFeatureConfigurable,org.rusherhack.core.interfaces.IClickable,org.rusherhack.core.interfaces.IDraggable,org.rusherhack.core.interfaces.IHoverable,org.rusherhack.core.interfaces.INamed,org.rusherhack.core.interfaces.ITickable,org.rusherhack.core.interfaces.IToggleable,org.rusherhack.core.logging.ILoggable,org.rusherhack.core.serialize.ISerializable<com.google.gson.JsonElement>,org.rusherhack.core.serialize.JsonSerializable
- Direct Known Subclasses:
ListHudElement,ResizeableHudElement,ShortListHudElement,TextHudElement
public abstract class HudElement
extends ScaledElementBase
implements IHudElement, org.rusherhack.core.bind.IBindable, org.rusherhack.core.event.listener.EventListener, org.rusherhack.core.logging.ILoggable, Globals
A hud element is a draggable
ElementBase that can be rendered on the screen.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumPoints at which hud elements are able to "snap" to -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected HudElement.AlignmentAlignment of this hud elementprotected final org.rusherhack.core.logging.ILoggerLogger for this hud element -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HudElement.AlignmentcalculateAlignment(double x, double y) static HudElement.AlignmentcalculateAlignment(HudElement element) protected voidcorrectPosition(HudElement.Alignment old, HudElement.Alignment newAlignment) booleandeserialize(com.google.gson.JsonElement jsonElement) org.rusherhack.core.logging.ILoggergetName()doublegetScale()List<org.rusherhack.core.setting.Setting<?>>doubledoubledoublegetX()doublegetY()booleanbooleanisHovered(double mouseX, double mouseY) booleanbooleanbooleanmouseClicked(double mouseX, double mouseY, int button) voidmouseMoved(double mouseX, double mouseY) voidmouseReleased(double mouseX, double mouseY, int button) voidvoidonEnable()voidvoidpostRender(RenderContext context, double mouseX, double mouseY) Some stuff shouldn't be rendered in nanovg contextvoidrender(RenderContext context, double mouseX, double mouseY) com.google.gson.JsonElementvoidsetDescription(String description) voidsetSnapPoint(HudElement.SnapPoint snapPoint) voidsetStartX(double x) voidsetStartY(double y) voidsetToggled(boolean toggled) voidsetX(double x) voidsetY(double y) booleanvoidtoggle()Methods inherited from class org.rusherhack.client.api.ui.ScaledElementBase
getScaledHeight, getScaledWidthMethods inherited from class org.rusherhack.client.api.ui.ElementBase
getHeight, getWidthMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.rusherhack.core.feature.IFeatureConfigurable
getSetting, registerSettings, resetMethods inherited from interface org.rusherhack.client.api.feature.hud.IHudElement
renderContent, renderContent, shouldDrawBackgroundMethods inherited from interface org.rusherhack.core.interfaces.INamed
getAliases, getDisplayNameMethods inherited from interface org.rusherhack.client.api.render.IRenderable2D
getRenderer, renderMethods inherited from interface org.rusherhack.core.serialize.ISerializable
shouldAutoSave, shouldSerializeMethods inherited from interface org.rusherhack.core.interfaces.ITickable
tick
-
Field Details
-
alignment
Alignment of this hud element -
logger
protected final org.rusherhack.core.logging.ILogger loggerLogger for this hud element
-
-
Constructor Details
-
HudElement
-
-
Method Details
-
render
- Specified by:
renderin interfaceIRenderable2D
-
correctPosition
-
postRender
Some stuff shouldn't be rendered in nanovg context -
getName
- Specified by:
getNamein interfaceorg.rusherhack.core.interfaces.INamed
-
getDescription
- Specified by:
getDescriptionin interfaceorg.rusherhack.core.feature.IFeature
-
setDescription
-
getSettings
- Specified by:
getSettingsin interfaceorg.rusherhack.core.feature.IFeatureConfigurable
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int button) - Specified by:
mouseClickedin interfaceorg.rusherhack.core.interfaces.IClickable
-
mouseReleased
public void mouseReleased(double mouseX, double mouseY, int button) - Specified by:
mouseReleasedin interfaceorg.rusherhack.core.interfaces.IClickable
-
mouseMoved
public void mouseMoved(double mouseX, double mouseY) - Specified by:
mouseMovedin interfaceorg.rusherhack.core.interfaces.IDraggable
-
isDragging
public boolean isDragging()- Specified by:
isDraggingin interfaceorg.rusherhack.core.interfaces.IDraggable
-
isHovered
public boolean isHovered(double mouseX, double mouseY) - Specified by:
isHoveredin interfaceorg.rusherhack.core.interfaces.IHoverable
-
toggle
public void toggle()- Specified by:
togglein interfaceorg.rusherhack.core.interfaces.IToggleable
-
onEnable
public void onEnable()- Specified by:
onEnablein interfaceorg.rusherhack.core.interfaces.IToggleable
-
onDisable
public void onDisable()- Specified by:
onDisablein interfaceorg.rusherhack.core.interfaces.IToggleable
-
getBindReference
- Specified by:
getBindReferencein interfaceorg.rusherhack.core.bind.IBindable
-
onKeybindEvent
public void onKeybindEvent()- Specified by:
onKeybindEventin interfaceorg.rusherhack.core.bind.IBindable
-
getLogger
public org.rusherhack.core.logging.ILogger getLogger()- Specified by:
getLoggerin interfaceorg.rusherhack.core.logging.ILoggable
-
isToggled
public boolean isToggled()- Specified by:
isToggledin interfaceorg.rusherhack.core.interfaces.IToggleable
-
setToggled
public void setToggled(boolean toggled) - Specified by:
setToggledin interfaceorg.rusherhack.core.interfaces.IToggleable
-
isListening
public boolean isListening()- Specified by:
isListeningin interfaceorg.rusherhack.core.event.listener.EventListener
-
setX
public void setX(double x) - Overrides:
setXin classElementBase
-
setY
public void setY(double y) - Overrides:
setYin classElementBase
-
getX
public double getX()- Overrides:
getXin classElementBase
-
getY
public double getY()- Overrides:
getYin classElementBase
-
getStartX
public double getStartX() -
getStartY
public double getStartY() -
setStartX
public void setStartX(double x) -
setStartY
public void setStartY(double y) -
getScale
public double getScale()- Overrides:
getScalein classScaledElementBase- Returns:
- The scale of this element
-
getFontRenderer
- Specified by:
getFontRendererin interfaceIRenderable2D
-
getSnapPoint
-
setSnapPoint
-
serialize
public com.google.gson.JsonElement serialize()- Specified by:
serializein interfaceorg.rusherhack.core.serialize.ISerializable<com.google.gson.JsonElement>
-
deserialize
public boolean deserialize(com.google.gson.JsonElement jsonElement) - Specified by:
deserializein interfaceorg.rusherhack.core.serialize.ISerializable<com.google.gson.JsonElement>
-
shouldUpdateAlignment
public boolean shouldUpdateAlignment() -
getAlignment
-
calculateAlignment
-
calculateAlignment
-