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

public class TextraArea.InnerTextraArea extends TextraField
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.
  • Constructor Details

    • InnerTextraArea

      public InnerTextraArea(@Null String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin)
    • 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.
      Sets Font.enableSquareBrackets and Font.omitCurlyBraces each to false on replacementFont. 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 TextraArea
      skin - a scene2d.ui Skin, typically an FWSkin or one of its subclasses
      replacementFont - a Font that will be modified in-place to diable brace/bracket markup parsing
    • InnerTextraArea

      public InnerTextraArea(@Null String text, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, String styleName)
    • InnerTextraArea

      public InnerTextraArea(@Null String text, Styles.TextFieldStyle style)
      Creates an InnerTextraArea with the given initial text, style, and replacementFont.
      This assumes the Styles.TextFieldStyle.font has not been modified; the constructor for TextFieldStyle copies any Font given to it so this can set Font.enableSquareBrackets and Font.omitCurlyBraces each to false on its copy without affecting other widget styles.
      Parameters:
      text - the initial text to hold in the TextraArea
      style - a TextFieldStyle from Styles
    • InnerTextraArea

      public InnerTextraArea(@Null String text, Styles.TextFieldStyle style, Font replacementFont)
      Creates an InnerTextraArea with the given initial text, style, and replacementFont.
      Sets Font.enableSquareBrackets and Font.omitCurlyBraces each to false on replacementFont. 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 TextraArea
      style - a TextFieldStyle from Styles
      replacementFont - 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:
      drawCursor in class TextraField
    • processLineBreaks

      protected String processLineBreaks(String text)
      Overrides:
      processLineBreaks in class TextraField
    • getTextY

      protected float getTextY(Font font, @Null com.badlogic.gdx.scenes.scene2d.utils.Drawable background)
      Overrides:
      getTextY in class TextraField
    • getPrefHeight

      public float getPrefHeight()
      Specified by:
      getPrefHeight in interface com.badlogic.gdx.scenes.scene2d.utils.Layout
      Overrides:
      getPrefHeight in class TextraField
    • moveCursor

      protected void moveCursor(boolean forward, boolean jump)
      Overrides:
      moveCursor in class TextraField
    • moveCursorVertically

      protected void moveCursorVertically(boolean forward, boolean jump)
      Overrides:
      moveCursorVertically in class TextraField
    • updateDisplayText

      protected void updateDisplayText()
      Overrides:
      updateDisplayText in class TextraField
    • sizeChanged

      protected void sizeChanged()
      Overrides:
      sizeChanged in class TextraField
    • insert

      protected boolean insert(int position, CharSequence inserting)
      Overrides:
      insert in class TextraField