Class WorldLabel

java.lang.Object
dev.myriadclient.api.render.WorldLabel

public final class WorldLabel extends Object
Labels pinned to points in the world (nametags, logout spots, item names), drawn on the 2D overlay.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    What's drawn behind a label's text.
    static final record 
    Where a label ended up on screen, so callers can stack things above it: its top-left corner and size in scaled GUI pixels, and the scale it was drawn at.
    static final record 
    A piece of a label: text in a colour, or an item icon (WorldLabel.Segment.item).
  • Method Summary

    Modifier and Type
    Method
    Description
    static float
    distanceScale(net.minecraft.world.phys.Vec3 world)
    Size multiplier that shrinks labels a little with distance (down to half size at 50+ blocks).
    static @Nullable WorldLabel.Placed
    draw(Canvas c, net.minecraft.world.phys.Vec3 world, float scale, List<WorldLabel.Segment> segments, WorldLabel.Background bg, int fill, int outline, boolean shadow)
    Draws segments side by side, centred on world with the label's bottom edge there, at scale times the default font size, on bg in ARGB fill with an ARGB outline (0 for none).

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • distanceScale

      public static float distanceScale(net.minecraft.world.phys.Vec3 world)
      Size multiplier that shrinks labels a little with distance (down to half size at 50+ blocks).
    • draw

      public static @Nullable WorldLabel.Placed draw(Canvas c, net.minecraft.world.phys.Vec3 world, float scale, List<WorldLabel.Segment> segments, WorldLabel.Background bg, int fill, int outline, boolean shadow)
      Draws segments side by side, centred on world with the label's bottom edge there, at scale times the default font size, on bg in ARGB fill with an ARGB outline (0 for none). Returns null when the point is behind the camera or well off screen. From a Render2DEvent.