public class TextWidget extends Widget implements Wrapped<TextBuffer>
| Modifier and Type | Field and Description |
|---|---|
protected TextBuffer |
text |
height, parent, visible, width, x, yBOOLEAN_VALUES, FABRIC, FORGE, FORGE_OR_NEOFORGE, GAME_VERSION, JAVA_17, JAVA_21, JAVA_8, JAVA_MODULES, JAVA_VERSION, JAVA_VERSION_ASM, LEGACY, MOD_LOADER, NAMED_ENV, NEOFORGE, SRG_ENV, V12, V16, V16_OR_EARLIER, V16_OR_LATER, V18, V18_OR_EARLIER, V18_OR_LATER, V19, V19_2_OR_EARLIER, V19_4_OR_LATER, V19_OR_EARLIER, V19_OR_LATER, V20, V20_4_OR_EARLIER, V20_6_OR_LATER, V20_OR_EARLIER, V20_OR_LATER, V21, V21_OR_LATER| Constructor and Description |
|---|
TextWidget(TextBuffer text,
double x,
double y) |
| Modifier and Type | Method and Description |
|---|---|
TextWidget |
copy() |
void |
draw(RenderContext ctx,
Vector3 center,
double mouseX,
double mouseY) |
static TextWidget |
from(TextAPI<?> text) |
static TextWidget |
from(TextAPI<?> text,
double x,
double y) |
static TextWidget |
from(TextBuffer buffer) |
static TextWidget |
from(TextBuffer buffer,
double x,
double y) |
ColorCache |
getColor() |
double |
getHeight() |
double |
getMaxX(double centerX,
double width,
double parentWidth) |
double |
getMaxY(double centerY,
double height) |
double |
getMinX(double centerX,
double width,
double parentWidth) |
double |
getMinY(double centerY,
double height) |
double |
getWidth() |
TextBuffer |
getWrapped() |
boolean |
isBlank() |
boolean |
isEmpty() |
boolean |
isNotBlank() |
boolean |
isNotEmpty() |
static TextWidget |
literal(java.lang.String literal) |
static TextWidget |
literal(java.lang.String literal,
double x,
double y) |
void |
onResolutionUpdated(MinecraftWindow window) |
TextWidget |
setColor(ColorCache color) |
TextWidget |
setText(java.lang.String text) |
TextWidget |
setText(TextAPI<?> text) |
TextWidget |
setText(TextBuffer text) |
void |
setWidth(double width) |
int |
textLength() |
java.lang.String |
toString() |
static TextWidget |
translated(java.lang.String key) |
static TextWidget |
translated(java.lang.String key,
double x,
double y) |
static TextWidget |
translated(java.lang.String key,
java.lang.Object... args) |
static TextWidget |
translated(java.lang.String key,
java.lang.Object[] args,
double x,
double y) |
canDraw, copyBasic, getBottom, getCenter, getCenter, getCenter, getLeft, getRight, getTop, getX, getY, isVisible, onScreenClosed, onScreenOpenedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetIfNotNull, getIfNotNullOrDefault, getIfNotNullOrDefault, getWrappedClass, isNull, isNullGetter, notNull, notNullGetter, supplyIfNull, unwrap, wrapIfNotNull, wrapIfNotNullOrDefault, wrapIfNotNullOrDefaultprotected TextBuffer text
public TextWidget(TextBuffer text, double x, double y)
public static TextWidget from(TextAPI<?> text)
public static TextWidget from(TextAPI<?> text, double x, double y)
public static TextWidget from(TextBuffer buffer)
public static TextWidget from(TextBuffer buffer, double x, double y)
public static TextWidget literal(java.lang.String literal)
public static TextWidget literal(java.lang.String literal, double x, double y)
public static TextWidget translated(java.lang.String key)
public static TextWidget translated(java.lang.String key, java.lang.Object... args)
public static TextWidget translated(java.lang.String key, double x, double y)
public static TextWidget translated(java.lang.String key, java.lang.Object[] args, double x, double y)
public ColorCache getColor()
public TextWidget copy()
public void draw(RenderContext ctx, Vector3 center, double mouseX, double mouseY)
public double getHeight()
public double getMaxX(double centerX,
double width,
double parentWidth)
public double getMaxY(double centerY,
double height)
public double getMinX(double centerX,
double width,
double parentWidth)
public double getMinY(double centerY,
double height)
public double getWidth()
public TextBuffer getWrapped()
getWrapped in interface Wrapped<TextBuffer>public boolean isBlank()
public boolean isNotBlank()
public boolean isNotEmpty()
public boolean isEmpty()
public void onResolutionUpdated(MinecraftWindow window)
onResolutionUpdated in class Widgetpublic TextWidget setColor(ColorCache color)
public TextWidget setText(java.lang.String text)
public TextWidget setText(TextAPI<?> text)
public TextWidget setText(TextBuffer text)
public void setWidth(double width)
public int textLength()
public java.lang.String toString()
toString in class java.lang.Object