Package dev.boze.api.render
Class Billboard
java.lang.Object
dev.boze.api.render.Billboard
Billboard rendering API for displaying 2D HUD elements at 3D world positions
Provides methods to render 2D graphics (lines, quads, text) that always face the camera
at specified 3D world positions. Use with HudDrawer and TextDrawer for rendering content.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstart(net.minecraft.util.math.Vec3d worldPosition, net.minecraft.client.gui.DrawContext drawContext, double scale) Starts billboard rendering at a 3D world position with constant scalingstatic booleanstart(net.minecraft.util.math.Vec3d worldPosition, net.minecraft.client.gui.DrawContext drawContext, double factor, double minScale, double maxScale) Starts billboard rendering at a 3D world position with distance-based scalingstatic voidstop(net.minecraft.client.gui.DrawContext drawContext) Ends billboard rendering and restores matrix state
-
Constructor Details
-
Billboard
public Billboard()
-
-
Method Details
-
start
public static boolean start(net.minecraft.util.math.Vec3d worldPosition, net.minecraft.client.gui.DrawContext drawContext, double factor, double minScale, double maxScale) Starts billboard rendering at a 3D world position with distance-based scaling The scale factor is calculated based on distance from camera using: scale = clamp(1.0 / distance, minScale, maxScale) * factor * 3.0 This mode scales elements based on their distance from the camera, making closer elements appear larger and farther elements appear smaller. Returns false if the position is not visible on screen- Parameters:
worldPosition- The 3D world position to render atdrawContext- The draw context to use for matrix operationsfactor- Base scale multiplierminScale- Minimum allowed scale valuemaxScale- Maximum allowed scale value- Returns:
- true if position is visible and rendering started, false otherwise
-
start
public static boolean start(net.minecraft.util.math.Vec3d worldPosition, net.minecraft.client.gui.DrawContext drawContext, double scale) Starts billboard rendering at a 3D world position with constant scaling The scale factor is constant regardless of distance from camera using: scale = clamp(1 - distance * 0.01, 0.5, MAX_VALUE) * scale This mode maintains consistent element sizes regardless of distance, with a slight fade-out effect for very distant elements. Returns false if the position is not visible on screen- Parameters:
worldPosition- The 3D world position to render atdrawContext- The draw context to use for matrix operationsscale- Constant scale factor- Returns:
- true if position is visible and rendering started, false otherwise
-
stop
public static void stop(net.minecraft.client.gui.DrawContext drawContext) Ends billboard rendering and restores matrix state Must be called after start() to clean up rendering state- Parameters:
drawContext- The draw context to restore matrix state for
-