Package org.rusherhack.client.api.ui.hud
Class HudHandlerBase
java.lang.Object
org.rusherhack.client.api.ui.ElementHandlerBase<HudElement>
org.rusherhack.client.api.ui.hud.HudHandlerBase
- All Implemented Interfaces:
Globals,IRenderable2D,org.rusherhack.core.interfaces.IClickable,org.rusherhack.core.interfaces.IDraggable,org.rusherhack.core.interfaces.IHoverable,org.rusherhack.core.interfaces.IScrollable,org.rusherhack.core.interfaces.ITickable,org.rusherhack.core.interfaces.ITypeable,org.rusherhack.core.serialize.ISerializable<com.google.gson.JsonElement>,org.rusherhack.core.serialize.JsonSerializable
Handler for hud elements
-
Field Summary
Fields inherited from class org.rusherhack.client.api.ui.ElementHandlerBase
positionsInitialized -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancharTyped(char character) protected booleanconsumeElementMouseClick(HudElement element, double mouseX, double mouseY, int button) protected ColorgetBackgroundColor(HudElement hudElement, double mouseX, double mouseY) voidInitialize all of the elementsbooleanisElementHovered(HudElement element, double mouseX, double mouseY) Checks if an element is hovered.booleankeyTyped(int key, int scanCode, int modifiers) booleanmouseClicked(double mouseX, double mouseY, int button) voidmouseMoved(double mouseX, double mouseY) voidmouseReleased(double mouseX, double mouseY, int button) booleanmouseScrolled(double mouseX, double mouseY, double delta) voidmoveElementToTop(HudElement element) Moves the element to the topvoidrender(RenderContext context, double mouseX, double mouseY) voidrenderElements(RenderContext renderContext, double mouseX, double mouseY) voidrenderHudElement(HudElement hudElement, RenderContext renderContext, double mouseX, double mouseY) protected voidrenderHudElementBackground(HudElement hudElement, RenderContext renderContext, IRenderer2D renderer, double width, double height, int color) Renders the background of a hud elementprotected voidrenderPrimitiveHudElement(HudElement hudElement, RenderContext renderContext, double mouseX, double mouseY) voidSets the default positions of the elementsvoidtick()Methods inherited from class org.rusherhack.client.api.ui.ElementHandlerBase
consumeElementCharTyped, consumeElementKeyTyped, consumeElementMouseMove, consumeElementMouseRelease, consumeElementMouseScroll, consumeMouseClick, consumeMouseMove, consumeMouseRelease, consumeMouseScroll, deserialize, getElement, getScale, isEnabled, isHovered, serialize, shouldSerializeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.rusherhack.core.interfaces.IDraggable
isDraggingMethods inherited from interface org.rusherhack.client.api.render.IRenderable2D
getRenderer, renderMethods inherited from interface org.rusherhack.core.serialize.ISerializable
shouldAutoSave
-
Constructor Details
-
HudHandlerBase
public HudHandlerBase(boolean scaledWithMinecraftGui) - Parameters:
scaledWithMinecraftGui- sets whether elements should be scaled with the minecraft gui
-
-
Method Details
-
getElements
- Specified by:
getElementsin classElementHandlerBase<HudElement>- Returns:
- elements to be handled by this handler
-
moveElementToTop
Description copied from class:ElementHandlerBaseMoves the element to the top- Specified by:
moveElementToTopin classElementHandlerBase<HudElement>- Parameters:
element- element to move to the top
-
render
- Specified by:
renderin interfaceIRenderable2D- Overrides:
renderin classElementHandlerBase<HudElement>
-
initialize
public void initialize()Description copied from class:ElementHandlerBaseInitialize all of the elements- Specified by:
initializein classElementHandlerBase<HudElement>
-
setDefaultPositions
public void setDefaultPositions()Description copied from class:ElementHandlerBaseSets the default positions of the elements- Specified by:
setDefaultPositionsin classElementHandlerBase<HudElement>
-
tick
public void tick()- Specified by:
tickin interfaceorg.rusherhack.core.interfaces.ITickable- Overrides:
tickin classElementHandlerBase<HudElement>
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int button) - Specified by:
mouseClickedin interfaceorg.rusherhack.core.interfaces.IClickable- Overrides:
mouseClickedin classElementHandlerBase<HudElement>
-
consumeElementMouseClick
protected boolean consumeElementMouseClick(HudElement element, double mouseX, double mouseY, int button) - Overrides:
consumeElementMouseClickin classElementHandlerBase<HudElement>
-
mouseReleased
public void mouseReleased(double mouseX, double mouseY, int button) - Specified by:
mouseReleasedin interfaceorg.rusherhack.core.interfaces.IClickable- Overrides:
mouseReleasedin classElementHandlerBase<HudElement>
-
mouseMoved
public void mouseMoved(double mouseX, double mouseY) - Specified by:
mouseMovedin interfaceorg.rusherhack.core.interfaces.IDraggable- Overrides:
mouseMovedin classElementHandlerBase<HudElement>
-
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double delta) - Specified by:
mouseScrolledin interfaceorg.rusherhack.core.interfaces.IScrollable- Overrides:
mouseScrolledin classElementHandlerBase<HudElement>
-
charTyped
public boolean charTyped(char character) - Specified by:
charTypedin interfaceorg.rusherhack.core.interfaces.ITypeable- Overrides:
charTypedin classElementHandlerBase<HudElement>
-
keyTyped
public boolean keyTyped(int key, int scanCode, int modifiers) - Specified by:
keyTypedin interfaceorg.rusherhack.core.interfaces.ITypeable- Overrides:
keyTypedin classElementHandlerBase<HudElement>
-
renderElements
- Overrides:
renderElementsin classElementHandlerBase<HudElement>
-
renderHudElement
public void renderHudElement(HudElement hudElement, RenderContext renderContext, double mouseX, double mouseY) -
renderPrimitiveHudElement
protected void renderPrimitiveHudElement(HudElement hudElement, RenderContext renderContext, double mouseX, double mouseY) -
getBackgroundColor
-
renderHudElementBackground
protected void renderHudElementBackground(HudElement hudElement, RenderContext renderContext, IRenderer2D renderer, double width, double height, int color) Renders the background of a hud element -
getHudManagerPanel
-
isElementHovered
Description copied from class:ElementHandlerBaseChecks if an element is hovered. Can be overridden to change the hover behavior.- Overrides:
isElementHoveredin classElementHandlerBase<HudElement>- Parameters:
element- the elementmouseX- the x-coordinate of the mousemouseY- the y-coordinate of the mouse- Returns:
- true if the window is hovered
-
getFontRenderer
-