Package com.github.tommyettinger.textra
Class TextraArea.InnerTextraArea
java.lang.Object
com.badlogic.gdx.scenes.scene2d.Actor
com.badlogic.gdx.scenes.scene2d.ui.Widget
com.github.tommyettinger.textra.TextraField
com.github.tommyettinger.textra.TextraArea.InnerTextraArea
- All Implemented Interfaces:
com.badlogic.gdx.scenes.scene2d.utils.Disableable,com.badlogic.gdx.scenes.scene2d.utils.Layout
- Enclosing class:
TextraArea
A multiple-line
TextraField using a Font; this is the inner multi-line text entry field
that gets scrolled through by the parent class. This class is not static because it needs to pass data
between itself and the parent that contains a ScrollPane for this widget.-
Nested Class Summary
Nested classes/interfaces inherited from class com.github.tommyettinger.textra.TextraField
TextraField.DefaultOnscreenKeyboard, TextraField.KeyRepeatTask, TextraField.NativeOnscreenKeyboard, TextraField.OnscreenKeyboard, TextraField.TextraFieldClickListener, TextraField.TextraFieldFilter, TextraField.TextraFieldListener -
Field Summary
Fields inherited from class com.github.tommyettinger.textra.TextraField
BACKSPACE, blinkEnabled, blinkTask, blinkTime, BULLET, CARRIAGE_RETURN, clipboard, cursor, cursorOn, DELETE, disabled, emojiReplacer, filter, focused, focusTraversal, fontOffset, glyphPositions, inputListener, keyboard, keyRepeatInitialTime, keyRepeatTask, keyRepeatTime, label, lastChangeTime, listener, maxLength, messageText, NEWLINE, onlyFontChars, passwordCharacter, passwordMode, programmaticChangeEvents, renderOffset, showingMessage, style, TAB, text, textHAlign, textOffset, undoText, visibleTextEnd, visibleTextStart, writeEntersFields inherited from class com.badlogic.gdx.scenes.scene2d.Actor
POOLS -
Constructor Summary
ConstructorsConstructorDescriptionInnerTextraArea(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin) InnerTextraArea(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, Font replacementFont) Creates an InnerTextraArea with the given initial text, skin to get a style from, and replacementFont.InnerTextraArea(String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, String styleName) InnerTextraArea(String text, Styles.TextFieldStyle style) Creates an InnerTextraArea with the given initial text, style, and replacementFont.InnerTextraArea(String text, Styles.TextFieldStyle style, Font replacementFont) Creates an InnerTextraArea with the given initial text, style, and replacementFont. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddrawCursor(com.badlogic.gdx.scenes.scene2d.utils.Drawable cursorPatch, com.badlogic.gdx.graphics.g2d.Batch batch, Font font, float x, float y) floatprotected floatprotected booleaninsert(int position, CharSequence inserting) protected voidmoveCursor(boolean forward, boolean jump) protected voidmoveCursorVertically(boolean forward, boolean jump) protected StringprocessLineBreaks(String text) protected voidprotected voidMethods inherited from class com.github.tommyettinger.textra.TextraField
act, appendText, calculateOffsets, clearSelection, continueCursor, copy, createInputListener, cut, cut, delete, draw, getAlignment, getAutocompleteOptions, getBackgroundDrawable, getBlinkTime, getCursorPosition, getDefaultInputListener, getMaxLength, getMessageText, getOnscreenKeyboard, getPasswordCharacter, getPrefWidth, getProgrammaticChangeEvents, getResolvedKeyboardType, getSelection, getSelectionEnd, getSelectionStart, getStyle, getText, getTextFieldFilter, initialize, isCursorBlinking, isDisabled, isPasswordMode, isSpaceCharacter, isSpaceCharacter, isWordCharacter, isWordCharacter, isWriteEnters, next, paste, positionChanged, selectAll, setAlignment, setAutocompleteOptions, setBlinkTime, setClipboard, setCursorBlinking, setCursorPosition, setDisabled, setFocusTraversal, setKeyboardType, setMaxLength, setMessageText, setOnlyFontChars, setOnscreenKeyboard, setParent, setPasswordCharacter, setPasswordMode, setPreventAutoCorrection, setProgrammaticChangeEvents, setSelection, setStage, setStyle, setText, setTextFieldFilter, setTextFieldListener, shouldPreventAutoCorrection, wordUnderCursorMethods inherited from class com.badlogic.gdx.scenes.scene2d.ui.Widget
getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, invalidate, invalidateHierarchy, layout, needsLayout, pack, setFillParent, setLayoutEnabled, validateMethods inherited from class com.badlogic.gdx.scenes.scene2d.Actor
addAction, addCaptureListener, addListener, ancestorsVisible, ascendantsVisible, clear, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, debug, drawDebug, drawDebugBounds, fire, firstAscendant, getActions, getCaptureListeners, getColor, getDebug, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getStage, getTop, getTouchable, getUserObject, getWidth, getX, getX, getY, getY, getZIndex, hasActions, hasKeyboardFocus, hasParent, hasScrollFocus, hit, isAscendantOf, isDescendantOf, isTouchable, isTouchFocusListener, isTouchFocusTarget, isVisible, localToActorCoordinates, localToAscendantCoordinates, localToParentCoordinates, localToScreenCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, remove, removeAction, removeCaptureListener, removeListener, rotateBy, rotationChanged, scaleBy, scaleBy, scaleChanged, screenToLocalCoordinates, setBounds, setColor, setColor, setDebug, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setUserObject, setVisible, setWidth, setX, setX, setY, setY, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFront, toString
-
Constructor Details
-
InnerTextraArea
-
InnerTextraArea
public InnerTextraArea(@Null String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, Font replacementFont) Creates an InnerTextraArea with the given initial text, skin to get a style from, and replacementFont.
SetsFont.enableSquareBracketsandFont.omitCurlyBraceseach to false onreplacementFont. This does not copy replacementFont; you can reuse an existing Font with those two fields set to false. Note that if you reuse a Font that is used in conjunction with markup, the modifications this makes to that Font will make that markup remain unparsed. You will typically want a different Font for your replacementFont used in TextraArea(s) than your Font(s) used elsewhere.- Parameters:
text- the initial text to hold in the TextraAreaskin- a scene2d.ui Skin, typically anFWSkinor one of its subclassesreplacementFont- a Font that will be modified in-place to diable brace/bracket markup parsing
-
InnerTextraArea
-
InnerTextraArea
Creates an InnerTextraArea with the given initial text, style, and replacementFont.
This assumes theStyles.TextFieldStyle.fonthas not been modified; the constructor for TextFieldStyle copies any Font given to it so this can setFont.enableSquareBracketsandFont.omitCurlyBraceseach to false on its copy without affecting other widget styles.- Parameters:
text- the initial text to hold in the TextraAreastyle- a TextFieldStyle fromStyles
-
InnerTextraArea
Creates an InnerTextraArea with the given initial text, style, and replacementFont.
SetsFont.enableSquareBracketsandFont.omitCurlyBraceseach to false onreplacementFont. This does not copy replacementFont; you can reuse an existing Font with those two fields set to false. Note that if you reuse a Font that is used in conjunction with markup, the modifications this makes to that Font will make that markup remain unparsed. You will typically want a different Font for your replacementFont used in TextraArea(s) than your Font(s) used elsewhere.- Parameters:
text- the initial text to hold in the TextraAreastyle- a TextFieldStyle fromStylesreplacementFont- a Font that will be modified in-place to diable brace/bracket markup parsing
-
-
Method Details
-
drawCursor
protected void drawCursor(com.badlogic.gdx.scenes.scene2d.utils.Drawable cursorPatch, com.badlogic.gdx.graphics.g2d.Batch batch, Font font, float x, float y) - Overrides:
drawCursorin classTextraField
-
processLineBreaks
- Overrides:
processLineBreaksin classTextraField
-
getTextY
protected float getTextY(Font font, @Null com.badlogic.gdx.scenes.scene2d.utils.Drawable background) - Overrides:
getTextYin classTextraField
-
getPrefHeight
public float getPrefHeight()- Specified by:
getPrefHeightin interfacecom.badlogic.gdx.scenes.scene2d.utils.Layout- Overrides:
getPrefHeightin classTextraField
-
moveCursor
protected void moveCursor(boolean forward, boolean jump) - Overrides:
moveCursorin classTextraField
-
moveCursorVertically
protected void moveCursorVertically(boolean forward, boolean jump) - Overrides:
moveCursorVerticallyin classTextraField
-
updateDisplayText
protected void updateDisplayText()- Overrides:
updateDisplayTextin classTextraField
-
sizeChanged
protected void sizeChanged()- Overrides:
sizeChangedin classTextraField
-
insert
- Overrides:
insertin classTextraField
-