Meteor’s HUD system lets you overlay text, shapes, and graphics on the game screen. HUD elements appear in the Meteor HUD editor (accessed via the GUI screen) and can be repositioned and configured by the user. Each element extendsDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/qualk/take-care/llms.txt
Use this file to discover all available pages before exploring further.
meteordevelopment.meteorclient.systems.hud.HudElement, declares a public static final HudElementInfo descriptor field, and is registered with Hud.get().register() in TakeCare.onInitialize(). Take Care declares a shared HUD_GROUP constant in TakeCare.java that all elements in the addon should use.
Creating a HUD element
Create a class extending HudElement
Add a new Java class inside the
hud/ package (kpn.qualk.takecare.hud). The class must extend meteordevelopment.meteorclient.systems.hud.HudElement:hud/YourHudElement.java
Define the static INFO field using TakeCare.HUD_GROUP
Every HUD element requires a
public static final HudElementInfo<T> descriptor. The HudElementInfo constructor takes four arguments:| Argument | Value |
|---|---|
group | TakeCare.HUD_GROUP — the shared Take Care HUD group |
name | A kebab-case string, e.g. "example" |
description | A plain-text sentence shown in the HUD editor |
factory | A method reference to the no-arg constructor, e.g. YourHudElement::new |
TakeCare.HUD_GROUP is declared as public static final HudGroup HUD_GROUP = new HudGroup("Take Care") in TakeCare.java and acts as the shared group for all Take Care HUD elements.Call super(INFO) in the constructor
The constructor must call
super(INFO) to pass the descriptor to the parent HudElement class. This registers the element’s name, description, and default size with the HUD system:hud/YourHudElement.java
Override render() to draw content
Override
The fields
render(HudRenderer renderer) to define what is drawn each frame. Use setSize(width, height) to tell the HUD editor the bounding box of your element so it can be selected and moved correctly.The HudRenderer provides these drawing primitives:| Method | Description |
|---|---|
renderer.text(text, x, y, color, shadow) | Draws a string at (x, y) |
renderer.textWidth(text, shadow) | Returns the pixel width of a string |
renderer.textHeight(shadow) | Returns the pixel height of a line of text |
renderer.quad(x, y, width, height, color) | Draws a filled rectangle |
x and y (inherited from HudElement) always contain the current top-left position of the element on screen:hud/HudExample.java
Full working example
Below is the completeHudExample class from the Take Care source (shown uncommented and ready to use):
hud/HudExample.java