Class Billboard

java.lang.Object
dev.boze.api.render.Billboard

public class Billboard extends Object
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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
    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
    static void
    stop(net.minecraft.client.gui.DrawContext drawContext)
    Ends billboard rendering and restores matrix state

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 at
      drawContext - The draw context to use for matrix operations
      factor - Base scale multiplier
      minScale - Minimum allowed scale value
      maxScale - 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 at
      drawContext - The draw context to use for matrix operations
      scale - 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