Class TextMesh

All Implemented Interfaces:
Behavior, Renderable, Closeable, AutoCloseable

public class TextMesh extends AbstractRenderable
TextMesh class extends AbstractRenderable and represents a text mesh object. It is used to render text with specified contents, color, and font.
  • Constructor Details

    • TextMesh

      public TextMesh()
      Constructs a new TextMesh.
  • Method Details

    • render

      public void render(Renderer renderer)
      Description copied from class: ComponentBehavior
      Renders the behavior.
      Specified by:
      render in interface Renderable
      Overrides:
      render in class AbstractRenderable
      Parameters:
      renderer - The renderer.
    • onStart

      public void onStart()
      Description copied from class: ComponentBehavior
      Called when the entity starts.
      Specified by:
      onStart in interface Behavior
      Overrides:
      onStart in class ComponentBehavior
    • contents

      public String contents()
      Returns the text contents of the TextMesh.
      Returns:
      The text contents.
    • setContents

      public TextMesh setContents(String contents)
      Sets the text contents of the TextMesh.
      Parameters:
      contents - The new text contents to be set.
      Returns:
      The TextMesh object for method chaining.
    • color

      public Color color()
      Returns the color of the TextMesh.
      Returns:
      The color of the text.
    • setColor

      public TextMesh setColor(Color color)
      Sets the color of the TextMesh.
      Parameters:
      color - The new color to be set.
      Returns:
      The TextMesh object for method chaining.