public class TextFieldWidget extends Widget implements IRenderable, IGuiEventListener
active, alpha, height, isHovered, nextNarration, packedFGColor, UNSET_FG_COLOR, visible, WIDGETS_LOCATION, width, x, yBACKGROUND_LOCATION, GUI_ICONS_LOCATION, STATS_ICON_LOCATION| コンストラクタと説明 |
|---|
TextFieldWidget(FontRenderer fontIn,
int xIn,
int yIn,
int widthIn,
int heightIn,
java.lang.String msg) |
TextFieldWidget(FontRenderer fontIn,
int xIn,
int yIn,
int widthIn,
int heightIn,
TextFieldWidget p_i51138_6_,
java.lang.String msg) |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
boolean |
canWrite() |
boolean |
changeFocus(boolean p_changeFocus_1_) |
boolean |
charTyped(char p_charTyped_1_,
int p_charTyped_2_) |
void |
clampCursorPosition(int pos) |
void |
deleteFromCursor(int num)
Deletes the given number of characters from the current cursor's position, unless there is currently a selection,
in which case the selection is deleted instead.
|
void |
deleteWords(int num)
Deletes the given number of words from the current cursor's position, unless there is currently a selection, in
which case the selection is deleted instead.
|
int |
func_195611_j(int p_195611_1_) |
int |
getAdjustedWidth()
returns the width of the textbox depending on if background drawing is enabled
|
int |
getCursorPosition()
returns the current position of the cursor
|
protected java.lang.String |
getNarrationMessage() |
int |
getNthWordFromCursor(int numWords)
Gets the starting index of the word at the specified number of words away from the cursor position.
|
java.lang.String |
getSelectedText()
returns the text between the cursor and selectionEnd
|
java.lang.String |
getText()
Returns the contents of the textbox
|
boolean |
getVisible()
returns true if this textbox is visible
|
boolean |
isMouseOver(double p_isMouseOver_1_,
double p_isMouseOver_3_) |
boolean |
keyPressed(int p_keyPressed_1_,
int p_keyPressed_2_,
int p_keyPressed_3_) |
boolean |
mouseClicked(double p_mouseClicked_1_,
double p_mouseClicked_3_,
int p_mouseClicked_5_) |
void |
moveCursorBy(int num)
Moves the text cursor by a specified number of characters and clears the selection
|
protected void |
onFocusedChanged(boolean p_onFocusedChanged_1_) |
void |
renderButton(int p_renderButton_1_,
int p_renderButton_2_,
float p_renderButton_3_) |
void |
setCanLoseFocus(boolean canLoseFocusIn)
Sets whether this text box loses focus when something other than it is clicked.
|
void |
setCursorPosition(int pos)
Sets the current position of the cursor.
|
void |
setCursorPositionEnd()
Moves the cursor to the very end of this text box.
|
void |
setCursorPositionZero()
Moves the cursor to the very start of this text box.
|
void |
setDisabledTextColour(int color)
Sets the color to use for text in this text box when this text box is disabled.
|
void |
setEnableBackgroundDrawing(boolean enableBackgroundDrawingIn)
Sets whether or not the background and outline of this text box should be drawn.
|
void |
setEnabled(boolean enabled)
Sets whether this text box is enabled.
|
void |
setFocused2(boolean isFocusedIn)
Sets focus to this gui element
|
void |
setMaxStringLength(int length)
Sets the maximum length for the text in this text box.
|
void |
setResponder(java.util.function.Consumer<java.lang.String> rssponderIn) |
void |
setSelectionPos(int position)
Sets the position of the selection anchor (the selection anchor and the cursor position mark the edges of the
selection).
|
void |
setSuggestion(java.lang.String p_195612_1_) |
void |
setText(java.lang.String textIn)
Sets the text of the textbox, and moves the cursor to the end.
|
void |
setTextColor(int color)
Sets the color to use when drawing this text box's text.
|
void |
setTextFormatter(java.util.function.BiFunction<java.lang.String,java.lang.Integer,java.lang.String> textFormatterIn) |
void |
setValidator(java.util.function.Predicate<java.lang.String> validatorIn) |
void |
setVisible(boolean isVisible)
Sets whether or not this textbox is visible
|
void |
setX(int xIn) |
void |
tick()
Increments the cursor counter
|
void |
writeText(java.lang.String textToWrite)
Adds the given text after the cursor, or replaces the currently selected text if there is a selection.
|
clearFGColor, clicked, getFGColor, getHeight, getMessage, getWidth, getYImage, isFocused, isHovered, isValidClickButton, mouseDragged, mouseReleased, narrate, onClick, onDrag, onRelease, playDownSound, queueNarration, render, renderBg, renderToolTip, setAlpha, setFGColor, setFocused, setHeight, setMessage, setWidthblit, blit, blit, blit, blit, drawCenteredString, drawRightAlignedString, drawString, fill, fill, fillGradient, getBlitOffset, hLine, innerBlit, setBlitOffset, vLineclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrenderkeyReleased, mouseDragged, mouseMoved, mouseReleased, mouseScrolledpublic TextFieldWidget(FontRenderer fontIn, int xIn, int yIn, int widthIn, int heightIn, java.lang.String msg)
public TextFieldWidget(FontRenderer fontIn, int xIn, int yIn, int widthIn, int heightIn, @Nullable TextFieldWidget p_i51138_6_, java.lang.String msg)
public void setResponder(java.util.function.Consumer<java.lang.String> rssponderIn)
public void setTextFormatter(java.util.function.BiFunction<java.lang.String,java.lang.Integer,java.lang.String> textFormatterIn)
public void tick()
protected java.lang.String getNarrationMessage()
getNarrationMessage クラス内 Widgetpublic void setText(java.lang.String textIn)
public java.lang.String getText()
public java.lang.String getSelectedText()
public void setValidator(java.util.function.Predicate<java.lang.String> validatorIn)
public void writeText(java.lang.String textToWrite)
public void deleteWords(int num)
public void deleteFromCursor(int num)
public int getNthWordFromCursor(int numWords)
public void moveCursorBy(int num)
public void setCursorPosition(int pos)
public void clampCursorPosition(int pos)
public void setCursorPositionZero()
public void setCursorPositionEnd()
public boolean keyPressed(int p_keyPressed_1_,
int p_keyPressed_2_,
int p_keyPressed_3_)
keyPressed インタフェース内 IGuiEventListenerpublic boolean canWrite()
public boolean charTyped(char p_charTyped_1_,
int p_charTyped_2_)
charTyped インタフェース内 IGuiEventListenerpublic boolean mouseClicked(double p_mouseClicked_1_,
double p_mouseClicked_3_,
int p_mouseClicked_5_)
mouseClicked インタフェース内 IGuiEventListenermouseClicked クラス内 Widgetpublic void setFocused2(boolean isFocusedIn)
public void renderButton(int p_renderButton_1_,
int p_renderButton_2_,
float p_renderButton_3_)
renderButton クラス内 Widgetpublic void setMaxStringLength(int length)
public int getCursorPosition()
public void setEnableBackgroundDrawing(boolean enableBackgroundDrawingIn)
public void setTextColor(int color)
public void setDisabledTextColour(int color)
public boolean changeFocus(boolean p_changeFocus_1_)
changeFocus インタフェース内 IGuiEventListenerchangeFocus クラス内 Widgetpublic boolean isMouseOver(double p_isMouseOver_1_,
double p_isMouseOver_3_)
isMouseOver インタフェース内 IGuiEventListenerisMouseOver クラス内 Widgetprotected void onFocusedChanged(boolean p_onFocusedChanged_1_)
onFocusedChanged クラス内 Widgetpublic void setEnabled(boolean enabled)
public int getAdjustedWidth()
public void setSelectionPos(int position)
public void setCanLoseFocus(boolean canLoseFocusIn)
public boolean getVisible()
public void setVisible(boolean isVisible)
public void setSuggestion(@Nullable
java.lang.String p_195612_1_)
public int func_195611_j(int p_195611_1_)
public void setX(int xIn)