Class WorldLabel
java.lang.Object
dev.myriadclient.api.render.WorldLabel
Labels pinned to points in the world (nametags, logout spots, item names), drawn on the 2D overlay.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhat's drawn behind a label's text.static final recordWhere 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 recordA piece of a label: text in a colour, or an item icon (WorldLabel.Segment.item). -
Method Summary
Modifier and TypeMethodDescriptionstatic floatdistanceScale(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.Placeddraw(Canvas c, net.minecraft.world.phys.Vec3 world, float scale, List<WorldLabel.Segment> segments, WorldLabel.Background bg, int fill, int outline, boolean shadow) Drawssegmentsside by side, centred onworldwith the label's bottom edge there, atscaletimes the default font size, onbgin ARGBfillwith an ARGBoutline(0 for none).
-
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) Drawssegmentsside by side, centred onworldwith the label's bottom edge there, atscaletimes the default font size, onbgin ARGBfillwith an ARGBoutline(0 for none). Returns null when the point is behind the camera or well off screen. From aRender2DEvent.
-