public abstract class Label extends WidgetWithBounds
| Modifier and Type | Field and Description |
|---|---|
static int |
CENTER |
static int |
LEFT_ALIGNED |
static int |
RIGHT_ALIGNED |
| Constructor and Description |
|---|
Label() |
| Modifier and Type | Method and Description |
|---|---|
@NotNull Label |
centered() |
@NotNull Label |
clickable()
Sets the label as clickable, ignores if onClick is set.
|
@NotNull Label |
clickable(boolean clickable)
Sets whether the label is clickable, ignores if onClick is set.
|
@NotNull Label |
color(int color) |
@NotNull Label |
color(int lightModeColor,
int darkModeColor) |
@NotNull Label |
focusable(boolean focusable)
Sets whether the label is focusable by pressing tab, ignored if not clickable.
|
abstract int |
getColor() |
abstract int |
getHorizontalAlignment()
Gets the horizontal alignment of the label, defaulted as centered.
|
abstract int |
getHoveredColor() |
abstract net.minecraft.util.text.ITextProperties |
getMessage() |
abstract @Nullable java.util.function.Consumer<Label> |
getOnClick() |
abstract @Nullable java.util.function.BiConsumer<com.mojang.blaze3d.matrix.MatrixStack,Label> |
getOnRender() |
abstract @NotNull me.shedaniel.math.Point |
getPoint() |
@NotNull net.minecraft.util.text.ITextComponent |
getText()
Deprecated.
|
abstract @Nullable java.lang.String |
getTooltip() |
int |
getX() |
int |
getY() |
abstract boolean |
hasShadow() |
Label |
horizontalAlignment(int horizontalAlignment) |
@NotNull Label |
hoveredColor(int color) |
@NotNull Label |
hoveredColor(int lightModeColor,
int darkModeColor) |
abstract boolean |
isClickable() |
abstract boolean |
isFocusable() |
@NotNull Label |
leftAligned() |
@NotNull Label |
message(@NotNull net.minecraft.util.text.ITextProperties message) |
@NotNull Label |
noShadow() |
@NotNull Label |
onClick(@Nullable java.util.function.Consumer<Label> onClick)
Sets the on click consumer, only applicable if the label is clickable.
|
@NotNull Label |
onRender(@Nullable java.util.function.BiConsumer<com.mojang.blaze3d.matrix.MatrixStack,Label> onRender)
Sets the consumer before render.
|
@NotNull Label |
point(@NotNull me.shedaniel.math.Point point) |
@NotNull Label |
rainbow(boolean rainbow) |
@NotNull Label |
rightAligned() |
abstract void |
setClickable(boolean clickable)
Sets whether the label is clickable, ignores if onClick is set.
|
abstract void |
setColor(int color) |
abstract void |
setFocusable(boolean focusable)
Sets whether the label is focusable by pressing tab, ignored if not clickable.
|
abstract void |
setHorizontalAlignment(int horizontalAlignment) |
abstract void |
setHoveredColor(int hoveredColor) |
abstract void |
setMessage(@NotNull net.minecraft.util.text.ITextProperties message) |
abstract void |
setOnClick(@Nullable java.util.function.Consumer<Label> onClick)
Sets the on click consumer, only applicable if the label is clickable.
|
abstract void |
setOnRender(@Nullable java.util.function.BiConsumer<com.mojang.blaze3d.matrix.MatrixStack,Label> onRender)
Sets the consumer before render.
|
abstract void |
setPoint(@NotNull me.shedaniel.math.Point point) |
abstract void |
setRainbow(boolean rainbow) |
abstract void |
setShadow(boolean hasShadow) |
void |
setText(@NotNull net.minecraft.util.text.ITextComponent text) |
abstract void |
setTooltip(@Nullable java.util.function.Function<Label,java.lang.String> tooltip)
Sets the tooltip function used to get the tooltip.
|
@NotNull Label |
shadow() |
@NotNull Label |
shadow(boolean hasShadow) |
@NotNull Label |
text(@NotNull net.minecraft.util.text.ITextComponent text) |
@NotNull Label |
tooltipLine(@Nullable java.lang.String tooltip)
Sets the tooltip.
|
@NotNull Label |
tooltipLines(java.lang.String... tooltip)
Sets the tooltip.
|
@NotNull Label |
tooltipSupplier(@Nullable java.util.function.Function<Label,java.lang.String> tooltip)
Sets the tooltip function.
|
containsMouse, getBoundscontainsMouse, containsMouse, getZ, isMouseOver, setZgetFocused, isDragging, setDragging, setFocusedblit, blit, blit, blit, blit, blitOutlineBlack, drawCenteredString, drawCenteredString, drawString, drawString, fill, fillGradient, fillGradient, getBlitOffset, hLine, innerBlit, setBlitOffset, vLineclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final int LEFT_ALIGNED
public static final int CENTER
public static final int RIGHT_ALIGNED
public abstract boolean isClickable()
public abstract void setClickable(boolean clickable)
clickable - whether the label is clickable.@NotNull public final @NotNull Label clickable()
@NotNull public final @NotNull Label clickable(boolean clickable)
clickable - whether the label is clickable.@Nullable public abstract @Nullable java.util.function.Consumer<Label> getOnClick()
public abstract void setOnClick(@Nullable
@Nullable java.util.function.Consumer<Label> onClick)
onClick - the on click consumer, only applicable if the label is clickable.@NotNull public final @NotNull Label onClick(@Nullable @Nullable java.util.function.Consumer<Label> onClick)
onClick - the on click consumer, only applicable if the label is clickable.@Nullable public abstract @Nullable java.util.function.BiConsumer<com.mojang.blaze3d.matrix.MatrixStack,Label> getOnRender()
public abstract void setOnRender(@Nullable
@Nullable java.util.function.BiConsumer<com.mojang.blaze3d.matrix.MatrixStack,Label> onRender)
onRender - the consumer before render.@NotNull public final @NotNull Label onRender(@Nullable @Nullable java.util.function.BiConsumer<com.mojang.blaze3d.matrix.MatrixStack,Label> onRender)
onRender - the consumer before render.public abstract boolean isFocusable()
public abstract void setFocusable(boolean focusable)
focusable - whether the label is focusable by pressing tab, ignored if not clickable.@NotNull public final @NotNull Label focusable(boolean focusable)
focusable - whether the label is focusable by pressing tab, ignored if not clickable.@Nullable public abstract @Nullable java.lang.String getTooltip()
public abstract void setTooltip(@Nullable
@Nullable java.util.function.Function<Label,java.lang.String> tooltip)
tooltip - the tooltip function used to get the tooltip.@NotNull public final @NotNull Label tooltipLines(@NotNull java.lang.String... tooltip)
tooltip - the lines of tooltip.@NotNull public final @NotNull Label tooltipLine(@Nullable @Nullable java.lang.String tooltip)
tooltip - the line of tooltip.@NotNull public final @NotNull Label tooltipSupplier(@Nullable @Nullable java.util.function.Function<Label,java.lang.String> tooltip)
tooltip - the tooltip function used to get the tooltip.public abstract int getHorizontalAlignment()
LEFT_ALIGNED if left aligned, CENTER if centered or RIGHT_ALIGNED if right aligned}.@NotNull public final @NotNull Label centered()
@NotNull public final @NotNull Label leftAligned()
@NotNull public final @NotNull Label rightAligned()
public abstract void setHorizontalAlignment(int horizontalAlignment)
public final Label horizontalAlignment(int horizontalAlignment)
public abstract boolean hasShadow()
@NotNull public final @NotNull Label noShadow()
@NotNull public final @NotNull Label shadow()
public abstract void setShadow(boolean hasShadow)
@NotNull public final @NotNull Label shadow(boolean hasShadow)
public abstract int getColor()
public abstract void setColor(int color)
@NotNull public final @NotNull Label color(int lightModeColor, int darkModeColor)
@NotNull public final @NotNull Label color(int color)
public abstract int getHoveredColor()
public abstract void setHoveredColor(int hoveredColor)
@NotNull public final @NotNull Label hoveredColor(int lightModeColor, int darkModeColor)
@NotNull public final @NotNull Label hoveredColor(int color)
@NotNull public abstract @NotNull me.shedaniel.math.Point getPoint()
public final int getX()
public final int getY()
public abstract void setPoint(@NotNull
@NotNull me.shedaniel.math.Point point)
@NotNull public final @NotNull Label point(@NotNull @NotNull me.shedaniel.math.Point point)
@NotNull @ApiStatus.ScheduledForRemoval @Deprecated public @NotNull net.minecraft.util.text.ITextComponent getText()
public abstract net.minecraft.util.text.ITextProperties getMessage()
public final void setText(@NotNull
@NotNull net.minecraft.util.text.ITextComponent text)
public abstract void setMessage(@NotNull
@NotNull net.minecraft.util.text.ITextProperties message)
public abstract void setRainbow(boolean rainbow)
@NotNull public final @NotNull Label text(@NotNull @NotNull net.minecraft.util.text.ITextComponent text)
@NotNull public final @NotNull Label message(@NotNull @NotNull net.minecraft.util.text.ITextProperties message)
@NotNull public final @NotNull Label rainbow(boolean rainbow)