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
Modifier and TypeClassDescriptionstatic enum
static enum
Points at which hud elements are able to "snap" to -
Field Summary
Modifier and TypeFieldDescriptionprotected HudElement.Alignment
Alignment of this hud elementprotected final org.rusherhack.core.logging.ILogger
Logger for this hud element -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic HudElement.Alignment
calculateAlignment
(double x, double y) static HudElement.Alignment
calculateAlignment
(HudElement element) protected void
correctPosition
(HudElement.Alignment old, HudElement.Alignment newAlignment) boolean
deserialize
(com.google.gson.JsonElement jsonElement) org.rusherhack.core.logging.ILogger
getName()
double
getScale()
List<org.rusherhack.core.setting.Setting<?>>
double
double
double
getX()
double
getY()
boolean
boolean
isHovered
(double mouseX, double mouseY) boolean
boolean
boolean
mouseClicked
(double mouseX, double mouseY, int button) void
mouseMoved
(double mouseX, double mouseY) void
mouseReleased
(double mouseX, double mouseY, int button) void
void
onEnable()
void
void
postRender
(RenderContext context, double mouseX, double mouseY) Some stuff shouldn't be rendered in nanovg contextvoid
render
(RenderContext context, double mouseX, double mouseY) com.google.gson.JsonElement
void
setDescription
(String description) void
setSnapPoint
(HudElement.SnapPoint snapPoint) void
setStartX
(double x) void
setStartY
(double y) void
setToggled
(boolean toggled) void
setX
(double x) void
setY
(double y) boolean
void
toggle()
Methods inherited from class org.rusherhack.client.api.ui.ScaledElementBase
getScaledHeight, getScaledWidth
Methods inherited from class org.rusherhack.client.api.ui.ElementBase
getHeight, getWidth
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.rusherhack.core.feature.IFeatureConfigurable
getSetting, registerSettings, reset
Methods inherited from interface org.rusherhack.client.api.feature.hud.IHudElement
renderContent, renderContent, shouldDrawBackground
Methods inherited from interface org.rusherhack.core.interfaces.INamed
getAliases, getDisplayName
Methods inherited from interface org.rusherhack.client.api.render.IRenderable2D
getRenderer, render
Methods inherited from interface org.rusherhack.core.serialize.ISerializable
shouldAutoSave, shouldSerialize
Methods 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:
render
in interfaceIRenderable2D
-
correctPosition
-
postRender
Some stuff shouldn't be rendered in nanovg context -
getName
- Specified by:
getName
in interfaceorg.rusherhack.core.interfaces.INamed
-
getDescription
- Specified by:
getDescription
in interfaceorg.rusherhack.core.feature.IFeature
-
setDescription
-
getSettings
- Specified by:
getSettings
in interfaceorg.rusherhack.core.feature.IFeatureConfigurable
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int button) - Specified by:
mouseClicked
in interfaceorg.rusherhack.core.interfaces.IClickable
-
mouseReleased
public void mouseReleased(double mouseX, double mouseY, int button) - Specified by:
mouseReleased
in interfaceorg.rusherhack.core.interfaces.IClickable
-
mouseMoved
public void mouseMoved(double mouseX, double mouseY) - Specified by:
mouseMoved
in interfaceorg.rusherhack.core.interfaces.IDraggable
-
isDragging
public boolean isDragging()- Specified by:
isDragging
in interfaceorg.rusherhack.core.interfaces.IDraggable
-
isHovered
public boolean isHovered(double mouseX, double mouseY) - Specified by:
isHovered
in interfaceorg.rusherhack.core.interfaces.IHoverable
-
toggle
public void toggle()- Specified by:
toggle
in interfaceorg.rusherhack.core.interfaces.IToggleable
-
onEnable
public void onEnable()- Specified by:
onEnable
in interfaceorg.rusherhack.core.interfaces.IToggleable
-
onDisable
public void onDisable()- Specified by:
onDisable
in interfaceorg.rusherhack.core.interfaces.IToggleable
-
getBindReference
- Specified by:
getBindReference
in interfaceorg.rusherhack.core.bind.IBindable
-
onKeybindEvent
public void onKeybindEvent()- Specified by:
onKeybindEvent
in interfaceorg.rusherhack.core.bind.IBindable
-
getLogger
public org.rusherhack.core.logging.ILogger getLogger()- Specified by:
getLogger
in interfaceorg.rusherhack.core.logging.ILoggable
-
isToggled
public boolean isToggled()- Specified by:
isToggled
in interfaceorg.rusherhack.core.interfaces.IToggleable
-
setToggled
public void setToggled(boolean toggled) - Specified by:
setToggled
in interfaceorg.rusherhack.core.interfaces.IToggleable
-
isListening
public boolean isListening()- Specified by:
isListening
in interfaceorg.rusherhack.core.event.listener.EventListener
-
setX
public void setX(double x) - Overrides:
setX
in classElementBase
-
setY
public void setY(double y) - Overrides:
setY
in classElementBase
-
getX
public double getX()- Overrides:
getX
in classElementBase
-
getY
public double getY()- Overrides:
getY
in 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:
getScale
in classScaledElementBase
- Returns:
- The scale of this element
-
getFontRenderer
- Specified by:
getFontRenderer
in interfaceIRenderable2D
-
getSnapPoint
-
setSnapPoint
-
serialize
public com.google.gson.JsonElement serialize()- Specified by:
serialize
in interfaceorg.rusherhack.core.serialize.ISerializable<com.google.gson.JsonElement>
-
deserialize
public boolean deserialize(com.google.gson.JsonElement jsonElement) - Specified by:
deserialize
in interfaceorg.rusherhack.core.serialize.ISerializable<com.google.gson.JsonElement>
-
shouldUpdateAlignment
public boolean shouldUpdateAlignment() -
getAlignment
-
calculateAlignment
-
calculateAlignment
-