com.badlogic.gdx.scenes.scene2d.ui
Class TextArea

java.lang.Object
  extended by com.badlogic.gdx.scenes.scene2d.Actor
      extended by com.badlogic.gdx.scenes.scene2d.ui.Widget
          extended by com.badlogic.gdx.scenes.scene2d.ui.TextField
              extended by com.badlogic.gdx.scenes.scene2d.ui.TextArea
All Implemented Interfaces:
Disableable, Layout

public class TextArea
extends TextField

A multiple-line text input field, entirely based on TextField


Nested Class Summary
 class TextArea.TextAreaListener
          Input listener for the text area
 
Nested classes/interfaces inherited from class com.badlogic.gdx.scenes.scene2d.ui.TextField
TextField.DefaultOnscreenKeyboard, TextField.OnscreenKeyboard, TextField.TextFieldClickListener, TextField.TextFieldFilter, TextField.TextFieldListener, TextField.TextFieldStyle
 
Constructor Summary
TextArea(String text, Skin skin)
           
TextArea(String text, Skin skin, String styleName)
           
TextArea(String text, TextField.TextFieldStyle style)
           
 
Method Summary
 int getCursorLine()
           
 int getFirstLineShowing()
           
 int getLines()
          Returns total number of lines that the text occupies
 int getLinesShowing()
           
 float getPrefHeight()
           
 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.
 
Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.TextField
clearSelection, copy, cut, draw, getCursorPosition, getDefaultInputListener, getMaxLength, getMessageText, getOnscreenKeyboard, getPrefWidth, getSelection, getSelectionStart, getStyle, getText, getTextFieldFilter, isDisabled, isPasswordMode, next, selectAll, setBlinkTime, setClipboard, setCursorPosition, setDisabled, setFocusTraversal, setMaxLength, setMessageText, setOnlyFontChars, setOnscreenKeyboard, setPasswordCharacter, setPasswordMode, setRightAligned, setStyle, setText, setTextFieldFilter, setTextFieldListener
 
Methods inherited from class com.badlogic.gdx.scenes.scene2d.ui.Widget
getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, invalidate, invalidateHierarchy, layout, needsLayout, pack, setFillParent, setLayoutEnabled, validate
 
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Actor
act, addAction, addCaptureListener, addListener, clear, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, fire, getActions, getCaptureListeners, getColor, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getWidth, getX, getY, getZIndex, hasParent, hit, isAscendantOf, isDescendantOf, isTouchable, isVisible, localToAscendantCoordinates, localToParentCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, remove, removeAction, removeCaptureListener, removeListener, rotateBy, scaleBy, scaleBy, screenToLocalCoordinates, setBounds, setColor, setColor, setHeight, setName, setOrigin, setOriginX, setOriginY, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setUserObject, setVisible, setWidth, setX, setY, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFront, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextArea

public TextArea(String text,
                Skin skin)

TextArea

public TextArea(String text,
                Skin skin,
                String styleName)

TextArea

public TextArea(String text,
                TextField.TextFieldStyle style)
Method Detail

setPrefRows

public void setPrefRows(float prefRows)
Sets the preferred number of rows (lines) for this text area. Used to calculate preferred height


getPrefHeight

public float getPrefHeight()
Specified by:
getPrefHeight in interface Layout
Overrides:
getPrefHeight in class TextField

getLines

public int getLines()
Returns total number of lines that the text occupies


newLineAtEnd

public boolean newLineAtEnd()
Returns if there's a new line at then end of the text


moveCursorLine

public void moveCursorLine(int line)
Moves the cursor to the given number line


setSelection

public void setSelection(int selectionStart,
                         int selectionEnd)
Description copied from class: TextField
Sets the selected text.

Overrides:
setSelection in class TextField

getCursorLine

public int getCursorLine()

getFirstLineShowing

public int getFirstLineShowing()

getLinesShowing

public int getLinesShowing()


Copyright © 2014. All Rights Reserved.