| Modifier and Type | Class and Description |
|---|---|
| public class | TextArea.
Input listener for the text area |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | cursorLine
Current line for the cursor |
| pack-priv int | firstLineShowing
Index of the first line showed by the text area |
| private String | lastText
Last text processed. |
| pack-priv IntArray | linesBreak
Array storing lines breaks positions |
| private int | linesShowing
Number of lines showed by the text area |
| pack-priv float | moveOffset
Variable to maintain the x offset of the cursor when moving up and down. |
| private float |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| private int | |
| protected void | |
| protected boolean | continueCursor(int index, int offset)
Overrides com.
|
| protected InputListener | |
| protected void | drawCursor(Drawable cursorPatch, Batch batch, BitmapFont font, float x, float y)
Overrides com.
|
| protected void | drawSelection(Drawable selection, Batch batch, BitmapFont font, float x, float y)
Overrides com. Draws selection rectangle |
| protected void | drawText(Batch batch, BitmapFont font, float x, float y)
Overrides com.
|
| public int | |
| public float | |
| public float | |
| public int | |
| public int | |
| public int | |
| public float | |
| protected float | getTextY(BitmapFont font, Drawable background)
Overrides com.
|
| protected void | |
| protected int | |
| protected void | moveCursor(boolean forward, boolean jump)
Overrides com.
|
| public void | |
| public boolean | |
| public void | |
| public void | setSelection(int selectionStart, int selectionEnd)
Overrides com. Sets the selected text. |
| public void | setStyle(TextField.
Overrides com. Implements com. Set the current style of the actor |
| pack-priv void | |
| protected void | sizeChanged()
Overrides com. Called when the actor's size has been changed. |
| pack-priv void | |
| pack-priv void |
| cursorLine | back to summary |
|---|---|
| pack-priv int cursorLine Current line for the cursor | |
| firstLineShowing | back to summary |
|---|---|
| pack-priv int firstLineShowing Index of the first line showed by the text area | |
| lastText | back to summary |
|---|---|
| private String lastText Last text processed. This attribute is used to avoid unnecessary computations while calculating offsets | |
| linesBreak | back to summary |
|---|---|
| pack-priv IntArray linesBreak Array storing lines breaks positions | |
| linesShowing | back to summary |
|---|---|
| private int linesShowing Number of lines showed by the text area | |
| moveOffset | back to summary |
|---|---|
| pack-priv float moveOffset Variable to maintain the x offset of the cursor when moving up and down. If it's set to -1, the offset is reset | |
| prefRows | back to summary |
|---|---|
| private float prefRows | |
| TextArea | back to summary |
|---|---|
| public TextArea(String text, Skin skin) | |
| TextArea | back to summary |
|---|---|
| public TextArea(String text, Skin skin, String styleName) | |
| TextArea | back to summary |
|---|---|
| public TextArea(String text, TextField. | |
| calculateCurrentLineIndex | back to summary |
|---|---|
| private int calculateCurrentLineIndex(int cursor) Calculates the text area line for the given cursor position | |
| calculateOffsets | back to summary |
|---|---|
| protected void calculateOffsets() Overrides com. | |
| continueCursor | back to summary |
|---|---|
| protected boolean continueCursor(int index, int offset) Overrides com. | |
| createInputListener | back to summary |
|---|---|
| protected InputListener createInputListener() Overrides com. | |
| drawCursor | back to summary |
|---|---|
| protected void drawCursor(Drawable cursorPatch, Batch batch, BitmapFont font, float x, float y) Overrides com. | |
| drawSelection | back to summary |
|---|---|
| protected void drawSelection(Drawable selection, Batch batch, BitmapFont font, float x, float y) Overrides com. Doc from com. Draws selection rectangle | |
| drawText | back to summary |
|---|---|
| protected void drawText(Batch batch, BitmapFont font, float x, float y) Overrides com. | |
| getCursorLine | back to summary |
|---|---|
| public int getCursorLine() | |
| getCursorX | back to summary |
|---|---|
| public float getCursorX() | |
| getCursorY | back to summary |
|---|---|
| public float getCursorY() | |
| getFirstLineShowing | back to summary |
|---|---|
| public int getFirstLineShowing() | |
| getLines | back to summary |
|---|---|
| public int getLines() Returns total number of lines that the text occupies | |
| getLinesShowing | back to summary |
|---|---|
| public int getLinesShowing() | |
| getPrefHeight | back to summary |
|---|---|
| public float getPrefHeight() Overrides com. Implements com. | |
| getTextY | back to summary |
|---|---|
| protected float getTextY(BitmapFont font, Drawable background) Overrides com. | |
| initialize | back to summary |
|---|---|
| protected void initialize() Overrides com. | |
| letterUnderCursor | back to summary |
|---|---|
| protected int letterUnderCursor(float x) Overrides com. | |
| moveCursor | back to summary |
|---|---|
| protected void moveCursor(boolean forward, boolean jump) Overrides com. | |
| moveCursorLine | back to summary |
|---|---|
| public void moveCursorLine(int line) Moves the cursor to the given number line | |
| newLineAtEnd | back to summary |
|---|---|
| public boolean newLineAtEnd() Returns if there's a new line at then end of the text | |
| setPrefRows | back to summary |
|---|---|
| public void setPrefRows(float prefRows) Sets the preferred number of rows (lines) for this text area. Used to calculate preferred height | |
| setSelection | back to summary |
|---|---|
| public void setSelection(int selectionStart, int selectionEnd) Overrides com. Doc from com. Sets the selected text. | |
| setStyle | back to summary |
|---|---|
| public void setStyle(TextField. Overrides com. Implements com. Doc from com. Set the current style of the actor | |
| showCursor | back to summary |
|---|---|
| pack-priv void showCursor() Scroll the text area to show the line of the cursor | |
| sizeChanged | back to summary |
|---|---|
| protected void sizeChanged() Overrides com. Doc from com. Called when the actor's size has been changed. | |
| updateCurrentLine | back to summary |
|---|---|
| pack-priv void updateCurrentLine() Updates the current line, checking the cursor position in the text | |
| updateFirstLineShowing | back to summary |
|---|---|
| pack-priv void updateFirstLineShowing() | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | checkFocusTraversal(char character)
Overrides com. Checks if focus traversal should be triggered. |
| protected void | goEnd(boolean jump)
Overrides com.
|
| protected void | goHome(boolean jump)
Overrides com.
|
| public boolean | keyDown(InputEvent event, int keycode)
Overrides com. Called when a key goes down. |
| public boolean | keyTyped(InputEvent event, char character)
Overrides com. Called when a key is typed. |
| protected void | setCursorPosition(float x, float y)
Overrides com.
|
| TextAreaListener | back to summary |
|---|---|
| public TextAreaListener() | |
| checkFocusTraversal | back to summary |
|---|---|
| protected boolean checkFocusTraversal(char character) Overrides com. Doc from com. Checks if focus traversal should be triggered. The default implementation uses | |
| goEnd | back to summary |
|---|---|
| protected void goEnd(boolean jump) Overrides com. | |
| goHome | back to summary |
|---|---|
| protected void goHome(boolean jump) Overrides com. | |
| keyDown | back to summary |
|---|---|
| public boolean keyDown(InputEvent event, int keycode) Overrides com. Doc from com. Called when a key goes down. When true is returned, the event is | |
| keyTyped | back to summary |
|---|---|
| public boolean keyTyped(InputEvent event, char character) Overrides com. Doc from com. Called when a key is typed. When true is returned, the event is | |
| setCursorPosition | back to summary |
|---|---|
| protected void setCursorPosition(float x, float y) Overrides com. | |