public class BasicTypeableWidget extends TextWidget implements Clickable, Selectable, Tickable, Typeable
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
buffer |
protected int |
charLimit |
protected ColorCache |
colorOverride |
protected int |
cursorBlinkCounter |
protected boolean |
selected |
textheight, 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 |
|---|
BasicTypeableWidget(TextBuffer text,
double x,
double y,
int charLimit) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canBackspace() |
boolean |
canCopy() |
boolean |
canCut() |
boolean |
canInteract(boolean checkEmpty) |
boolean |
canPaste(@Nullable java.lang.String text) |
boolean |
canType(char c) |
BasicTypeableWidget |
copy() |
void |
draw(RenderContext ctx,
Vector3 center,
double mouseX,
double mouseY) |
void |
drawSelected(RenderContext ctx,
Vector3 center,
double mouseX,
double mouseY) |
static BasicTypeableWidget |
from(TextAPI<?> text) |
static BasicTypeableWidget |
from(TextAPI<?> text,
ColorCache color) |
static BasicTypeableWidget |
from(TextAPI<?> text,
ColorCache color,
double x,
double y) |
static BasicTypeableWidget |
from(TextAPI<?> text,
ColorCache color,
double x,
double y,
int charLimit) |
static BasicTypeableWidget |
from(TextAPI<?> text,
double x,
double y) |
static BasicTypeableWidget |
from(TextAPI<?> text,
double x,
double y,
int charLimit) |
static BasicTypeableWidget |
from(TextBuffer buffer) |
static BasicTypeableWidget |
from(TextBuffer buffer,
double x,
double y) |
static BasicTypeableWidget |
from(TextBuffer buffer,
double x,
double y,
int charLimit) |
boolean |
isActivelyTicking() |
boolean |
isSelected() |
static BasicTypeableWidget |
literal(java.lang.String literal) |
static BasicTypeableWidget |
literal(java.lang.String literal,
ColorCache color) |
static BasicTypeableWidget |
literal(java.lang.String literal,
ColorCache color,
double x,
double y) |
static BasicTypeableWidget |
literal(java.lang.String literal,
ColorCache color,
double x,
double y,
int charLimit) |
static BasicTypeableWidget |
literal(java.lang.String literal,
double x,
double y) |
static BasicTypeableWidget |
literal(java.lang.String literal,
double x,
double y,
int charLimit) |
boolean |
onBackspace() |
boolean |
onCharTyped(char c) |
@Nullable java.lang.String |
onCopy() |
@Nullable java.lang.String |
onCut() |
boolean |
onKeyPressed(KeyStateCache cache,
int keyCode) |
boolean |
onLeftClick(double x,
double y) |
boolean |
onPaste(@Nullable java.lang.String text) |
boolean |
onRightClick(double x,
double y) |
void |
onScreenClosed() |
boolean |
onSelectAll() |
protected void |
onTextAdded(java.lang.String text) |
protected java.lang.String |
onTextRemoved() |
void |
onTick() |
void |
playLeftClickSound() |
void |
playRightClickSound() |
void |
resetHighlight() |
BasicTypeableWidget |
setText(TextBuffer text) |
static BasicTypeableWidget |
translated(java.lang.String key,
java.lang.Object[] args) |
static BasicTypeableWidget |
translated(java.lang.String key,
java.lang.Object[] args,
ColorCache color) |
static BasicTypeableWidget |
translated(java.lang.String key,
java.lang.Object[] args,
ColorCache color,
double x,
double y) |
static BasicTypeableWidget |
translated(java.lang.String key,
java.lang.Object[] args,
ColorCache color,
double x,
double y,
int charLimit) |
static BasicTypeableWidget |
translated(java.lang.String key,
java.lang.Object[] args,
double x,
double y) |
static BasicTypeableWidget |
translated(java.lang.String key,
java.lang.Object[] args,
double x,
double y,
int charLimit) |
getColor, getHeight, getMaxX, getMaxY, getMinX, getMinY, getWidth, getWrapped, isBlank, isEmpty, isNotBlank, isNotEmpty, onResolutionUpdated, setColor, setText, setText, setWidth, textLength, toString, translated, translatedcanDraw, copyBasic, getBottom, getCenter, getCenter, getCenter, getLeft, getRight, getTop, getX, getY, isVisible, onScreenOpenedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcanSelectAllgetIfNotNull, getIfNotNullOrDefault, getIfNotNullOrDefault, getWrappedClass, isNull, isNullGetter, notNull, notNullGetter, supplyIfNull, unwrap, wrapIfNotNull, wrapIfNotNullOrDefault, wrapIfNotNullOrDefaultprotected final int charLimit
protected java.lang.String buffer
protected int cursorBlinkCounter
protected ColorCache colorOverride
protected boolean selected
public BasicTypeableWidget(TextBuffer text, double x, double y, int charLimit)
public static BasicTypeableWidget from(TextAPI<?> text)
public static BasicTypeableWidget from(TextAPI<?> text, ColorCache color)
public static BasicTypeableWidget from(TextBuffer buffer)
public static BasicTypeableWidget from(TextAPI<?> text, double x, double y)
public static BasicTypeableWidget from(TextAPI<?> text, ColorCache color, double x, double y)
public static BasicTypeableWidget from(TextBuffer buffer, double x, double y)
public static BasicTypeableWidget from(TextAPI<?> text, double x, double y, int charLimit)
public static BasicTypeableWidget from(TextAPI<?> text, ColorCache color, double x, double y, int charLimit)
public static BasicTypeableWidget from(TextBuffer buffer, double x, double y, int charLimit)
public static BasicTypeableWidget literal(java.lang.String literal)
public static BasicTypeableWidget literal(java.lang.String literal, ColorCache color)
public static BasicTypeableWidget literal(java.lang.String literal, double x, double y)
public static BasicTypeableWidget literal(java.lang.String literal, ColorCache color, double x, double y)
public static BasicTypeableWidget literal(java.lang.String literal, double x, double y, int charLimit)
public static BasicTypeableWidget literal(java.lang.String literal, ColorCache color, double x, double y, int charLimit)
public static BasicTypeableWidget translated(java.lang.String key, java.lang.Object[] args)
public static BasicTypeableWidget translated(java.lang.String key, java.lang.Object[] args, ColorCache color)
public static BasicTypeableWidget translated(java.lang.String key, java.lang.Object[] args, double x, double y)
public static BasicTypeableWidget translated(java.lang.String key, java.lang.Object[] args, ColorCache color, double x, double y)
public static BasicTypeableWidget translated(java.lang.String key, java.lang.Object[] args, double x, double y, int charLimit)
public static BasicTypeableWidget translated(java.lang.String key, java.lang.Object[] args, ColorCache color, double x, double y, int charLimit)
public boolean canBackspace()
canBackspace in interface Typeablepublic boolean canInteract(boolean checkEmpty)
public boolean canPaste(@Nullable
@Nullable java.lang.String text)
public BasicTypeableWidget copy()
copy in class TextWidgetpublic void draw(RenderContext ctx, Vector3 center, double mouseX, double mouseY)
draw in class TextWidgetpublic void drawSelected(RenderContext ctx, Vector3 center, double mouseX, double mouseY)
drawSelected in interface Selectablepublic boolean isActivelyTicking()
isActivelyTicking in interface Tickablepublic boolean isSelected()
isSelected in interface Selectablepublic boolean onBackspace()
onBackspace in interface Typeablepublic boolean onCharTyped(char c)
onCharTyped in interface Typeable@Nullable public @Nullable java.lang.String onCopy()
public boolean onKeyPressed(KeyStateCache cache, int keyCode)
onKeyPressed in interface Typeablepublic boolean onLeftClick(double x,
double y)
onLeftClick in interface Clickablepublic boolean onPaste(@Nullable
@Nullable java.lang.String text)
public boolean onRightClick(double x,
double y)
onRightClick in interface Clickablepublic void onScreenClosed()
onScreenClosed in class Widgetpublic boolean onSelectAll()
onSelectAll in interface Typeableprotected void onTextAdded(java.lang.String text)
protected java.lang.String onTextRemoved()
public void playLeftClickSound()
playLeftClickSound in interface Clickablepublic void playRightClickSound()
playRightClickSound in interface Clickablepublic void resetHighlight()
public BasicTypeableWidget setText(TextBuffer text)
setText in class TextWidget