Class HudDrawer
java.lang.Object
dev.boze.api.render.HudDrawer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddraw()Renders the current drawing session to the screen
Throws RuntimeException if start() was not called firststatic floatgetScale()Gets the current global HUD scale (the Hud module's Scale setting).static voidline(ColorOption.Value colorOption, double x1, double y1, double x2, double y2) Renders a line using ColorOption.Value
Throws RuntimeException if start() was not called firststatic voidline(ClientColor color, float opacity, double x1, double y1, double x2, double y2) Renders a line
Throws RuntimeException if start() was not called firststatic voidquad(ColorOption.Value colorOption, double x, double y, double width, double height) Renders a quad/filled rectangle using ColorOption.Value
Throws RuntimeException if start() was not called firststatic voidquad(ClientColor color, float opacity, double x, double y, double width, double height) Renders a quad/filled rectangle
Throws RuntimeException if start() was not called firststatic voidstart()Starts a new HUD drawing session
Must be called before any drawing operations.
-
Constructor Details
-
HudDrawer
public HudDrawer()
-
-
Method Details
-
start
public static void start()Starts a new HUD drawing session
Must be called before any drawing operations. Throws RuntimeException if already started -
getScale
public static float getScale()Gets the current global HUD scale (the Hud module's Scale setting).- Returns:
- The HUD scale, defaulting to 1.0
-
draw
public static void draw()Renders the current drawing session to the screen
Throws RuntimeException if start() was not called first -
line
public static void line(ClientColor color, float opacity, double x1, double y1, double x2, double y2) Renders a line
Throws RuntimeException if start() was not called first- Parameters:
color- The color to useopacity- The opacity valuex1- Starting X coordinatey1- Starting Y coordinatex2- Ending X coordinatey2- Ending Y coordinate
-
quad
public static void quad(ClientColor color, float opacity, double x, double y, double width, double height) Renders a quad/filled rectangle
Throws RuntimeException if start() was not called first- Parameters:
color- The color to useopacity- The opacity valuex- X coordinatey- Y coordinatewidth- Width of the quadheight- Height of the quad
-
line
Renders a line using ColorOption.Value
Throws RuntimeException if start() was not called first- Parameters:
colorOption- The color option value containing color and opacity settingsx1- Starting X coordinatey1- Starting Y coordinatex2- Ending X coordinatey2- Ending Y coordinate
-
quad
public static void quad(ColorOption.Value colorOption, double x, double y, double width, double height) Renders a quad/filled rectangle using ColorOption.Value
Throws RuntimeException if start() was not called first- Parameters:
colorOption- The color option value containing color and opacity settingsx- X coordinatey- Y coordinatewidth- Width of the quadheight- Height of the quad
-