Class RenderedText

All Implemented Interfaces:
Hintable, Renderable, Savable

public class RenderedText extends Node implements Renderable
  • Field Details

    • _plainText

      protected String _plainText
    • _parsedStyles

      protected List<StyleSpan> _parsedStyles
    • _width

      protected float _width
    • _height

      protected float _height
    • data

      protected final RenderedText.RenderedTextData data
    • _styled

      protected boolean _styled
  • Constructor Details

    • RenderedText

      public RenderedText()
  • Method Details

    • getText

      public String getText()
    • setPlainText

      public void setPlainText(String text)
    • getPlainText

      public String getPlainText()
    • setHeight

      public void setHeight(float height)
    • getHeight

      public float getHeight()
    • setWidth

      public void setWidth(float width)
    • getWidth

      public float getWidth()
    • getParsedStyleSpans

      public List<StyleSpan> getParsedStyleSpans()
    • setParsedStyleSpans

      public void setParsedStyleSpans(Collection<StyleSpan> spans)
    • attachChild

      public int attachChild(Spatial child)
      Description copied from class: Node
      attachChild attaches a child to this node. This node becomes the child's parent. The current number of children maintained is returned.
      If the child already had a parent it is detached from that former parent.
      Overrides:
      attachChild in class Node
      Parameters:
      child - the child to attach to this node.
      Returns:
      the number of children maintained by this node.
    • attachChildAt

      public int attachChildAt(Spatial child, int index)
      Description copied from class: Node
      attachChildAt attaches a child to this node at an index. This node becomes the child's parent. The current number of children maintained is returned.
      If the child already had a parent it is detached from that former parent.
      Overrides:
      attachChildAt in class Node
      Parameters:
      child - the child to attach to this node.
      index - the index of the child to be attached.
      Returns:
      the number of children maintained by this node.
    • draw

      public void draw(Renderer r)
      Description copied from class: Node
      draw calls the onDraw method for each child maintained by this node.
      Overrides:
      draw in class Node
      Parameters:
      r - the renderer to draw to.
      See Also:
    • updateWorldBound

      public void updateWorldBound(boolean recurse)
      Description copied from class: Node
      updateWorldBound merges the bounds of all the children maintained by this node. This will allow for faster culling operations.
      Overrides:
      updateWorldBound in class Node
      Parameters:
      recurse - true to recurse down the scenegraph tree
      See Also:
    • render

      public void render(Renderer renderer)
      Description copied from interface: Renderable
      Render the object using the supplied renderer instance.
      Specified by:
      render in interface Renderable
      Parameters:
      renderer - the renderer
    • setWorldTransform

      public void setWorldTransform(ReadOnlyTransform transform)
      Description copied from class: Spatial
      Sets the world transform.
      Overrides:
      setWorldTransform in class Spatial
      Parameters:
      transform - the new world transform
    • getData

    • findCaretTranslation

      public Vector2 findCaretTranslation(int caretPosition, Vector2 store)
    • findCaretPosition

      public int findCaretPosition(int x, int y)
    • getLineHeight

      public int getLineHeight(int caretPosition)
    • setStyled

      public void setStyled(boolean styled)
    • isStyled

      public boolean isStyled()