Class TextScene

java.lang.Object
com.calebleavell.textinterface.scenes.GenericScene
com.calebleavell.textinterface.scenes.TextScene
All Implemented Interfaces:
Function, Scene

public class TextScene extends GenericScene
Displays a piece of text
  • Constructor Details

    • TextScene

      protected TextScene(TextScene.Builder builder)
      Return new TextScene based on builder fields
      Parameters:
      builder - The builder
  • Method Details

    • getText

      public String getText()
      Getter for text
      Returns:
      Text
    • setText

      public void setText(String text)
      Setter for text
      Parameters:
      text - The new text
    • setEndWithNewLine

      public void setEndWithNewLine(boolean endWithNewLine)
      Setter for endWithNewLine
      Parameters:
      endWithNewLine - Whether or not the program should end with a newline
    • run

      public void run() throws Exception
      Displays the input if that's set, or more commonly, displays its set text. Ends with a newline if that's set, then display children and run functions.
      Specified by:
      run in interface Function
      Overrides:
      run in class GenericScene
      Throws:
      Exception