public class TextArea extends TextField
TextField
Modifier and Type | Class and Description |
---|---|
class |
TextArea.TextAreaListener
Input listener for the text area
|
TextField.DefaultOnscreenKeyboard, TextField.OnscreenKeyboard, TextField.TextFieldClickListener, TextField.TextFieldFilter, TextField.TextFieldListener, TextField.TextFieldStyle
cursor, displayText, ENTER_ANDROID, ENTER_DESKTOP, glyphAdvances, glyphPositions, hasSelection, selectionStart, text, textHeight, textOffset, writeEnters
Constructor and Description |
---|
TextArea(java.lang.String text,
Skin skin) |
TextArea(java.lang.String text,
Skin skin,
java.lang.String styleName) |
TextArea(java.lang.String text,
TextField.TextFieldStyle style) |
Modifier and Type | Method and Description |
---|---|
protected void |
calculateOffsets() |
protected boolean |
continueCursor(int index,
int offset) |
protected InputListener |
createInputListener() |
protected void |
drawCursor(Drawable cursorPatch,
Batch batch,
BitmapFont font,
float x,
float y) |
protected void |
drawSelection(Drawable selection,
Batch batch,
BitmapFont font,
float x,
float y)
Draws selection rectangle
|
protected void |
drawText(Batch batch,
BitmapFont font,
float x,
float y) |
int |
getCursorLine() |
int |
getFirstLineShowing() |
int |
getLines()
Returns total number of lines that the text occupies
|
int |
getLinesShowing() |
float |
getPrefHeight() |
protected float |
getTextY(BitmapFont font,
Drawable background) |
protected void |
initialize() |
protected int |
letterUnderCursor(float x) |
protected void |
moveCursor(boolean forward,
boolean jump) |
void |
moveCursorLine(int line)
Moves the cursor to the given number line
|
boolean |
newLineAtEnd()
Returns if there's a new line at then end of the text
|
void |
setPrefRows(float prefRows)
Sets the preferred number of rows (lines) for this text area.
|
void |
setSelection(int selectionStart,
int selectionEnd)
Sets the selected text.
|
protected void |
sizeChanged()
Called when the actor's size has been changed.
|
clearSelection, copy, cut, draw, getCursorPosition, getDefaultInputListener, getMaxLength, getMessageText, getOnscreenKeyboard, getPrefWidth, getSelection, getSelectionStart, getStyle, getText, getTextFieldFilter, isDisabled, isPasswordMode, isWordCharacter, next, selectAll, setBlinkTime, setClipboard, setCursorPosition, setDisabled, setFocusTraversal, setMaxLength, setMessageText, setOnlyFontChars, setOnscreenKeyboard, setPasswordCharacter, setPasswordMode, setRightAligned, setStyle, setText, setTextFieldFilter, setTextFieldListener, wordUnderCursor
getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, invalidate, invalidateHierarchy, layout, needsLayout, pack, setFillParent, setLayoutEnabled, validate
act, addAction, addCaptureListener, addListener, clear, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, drawDebug, drawDebugBounds, fire, getActions, getCaptureListeners, getColor, getDebug, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getWidth, getX, getX, getY, getY, getZIndex, hasParent, hit, isAscendantOf, isDescendantOf, isTouchable, isVisible, localToAscendantCoordinates, localToParentCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, positionChanged, remove, removeAction, removeCaptureListener, removeListener, rotateBy, scaleBy, scaleBy, screenToLocalCoordinates, setBounds, setColor, setColor, setDebug, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setParent, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setStage, setTouchable, setUserObject, setVisible, setWidth, setX, setY, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFront, toString
public TextArea(java.lang.String text, Skin skin)
public TextArea(java.lang.String text, Skin skin, java.lang.String styleName)
public TextArea(java.lang.String text, TextField.TextFieldStyle style)
protected void initialize()
initialize
in class TextField
protected int letterUnderCursor(float x)
letterUnderCursor
in class TextField
public void setPrefRows(float prefRows)
public float getPrefHeight()
getPrefHeight
in interface Layout
getPrefHeight
in class TextField
public int getLines()
public boolean newLineAtEnd()
public void moveCursorLine(int line)
protected void sizeChanged()
Actor
sizeChanged
in class Widget
protected float getTextY(BitmapFont font, Drawable background)
protected void drawSelection(Drawable selection, Batch batch, BitmapFont font, float x, float y)
TextField
drawSelection
in class TextField
protected void drawText(Batch batch, BitmapFont font, float x, float y)
protected void drawCursor(Drawable cursorPatch, Batch batch, BitmapFont font, float x, float y)
drawCursor
in class TextField
protected void calculateOffsets()
calculateOffsets
in class TextField
protected InputListener createInputListener()
createInputListener
in class TextField
public void setSelection(int selectionStart, int selectionEnd)
TextField
setSelection
in class TextField
protected void moveCursor(boolean forward, boolean jump)
moveCursor
in class TextField
protected boolean continueCursor(int index, int offset)
continueCursor
in class TextField
public int getCursorLine()
public int getFirstLineShowing()
public int getLinesShowing()