Class Typewriter

java.lang.Object
net.dermetfan.gdx.Typewriter

public class Typewriter extends Object
A Typewriter writing a CharSequence.
Uses a CharSequenceInterpolator and Appender, so Interpolations and custom cursors can be used.
  • Constructor Details

    • Typewriter

      public Typewriter()
      instantiates a Typewriter using the default values
    • Typewriter

      public Typewriter(CharSequence cursor)
      instantiates a new Typewriter with the given cursor
    • Typewriter

      public Typewriter(boolean cursorWhileTyping, boolean cursorAfterTyping)
      instantiates a new Typewriter with the given cursorWhileTyping and cursorAfterTyping
    • Typewriter

      public Typewriter(CharSequence cursor, boolean cursorWhileTyping, boolean cursorAfterTyping)
      instantiates a new Typewriter with the given cursor, cursorWhileTyping and cursorAfterTyping
      See Also:
  • Method Details

    • update

      public void update(float delta)
      updates the time the Typewriter had to type
    • type

      public CharSequence type(CharSequence seq)
      Returns:
      the given CharSequence as far is it could be typed, with or without cursor
    • updateAndType

      public CharSequence updateAndType(CharSequence seq, float delta)
      See Also:
    • getCharsPerSecond

      public float getCharsPerSecond()
      See Also:
    • setCharsPerSecond

      public void setCharsPerSecond(float charsPerSecond)
      See Also:
    • getTime

      public float getTime()
      See Also:
    • setTime

      public void setTime(float time)
      See Also:
    • isCursorWhileTyping

      public boolean isCursorWhileTyping()
      Returns:
      the cursorWhileTyping
    • setCursorWhileTyping

      public void setCursorWhileTyping(boolean cursorWhileTyping)
      Parameters:
      cursorWhileTyping - the cursorWhileTyping to set
    • isCursorAfterTyping

      public boolean isCursorAfterTyping()
      Returns:
      the cursorAfterTyping
    • setCursorAfterTyping

      public void setCursorAfterTyping(boolean cursorAfterTyping)
      Parameters:
      cursorAfterTyping - the cursorAfterTyping to set
    • getInterpolator

      public CharSequenceInterpolator getInterpolator()
      Returns:
      the interpolator
    • setInterpolator

      public void setInterpolator(CharSequenceInterpolator interpolator)
      Parameters:
      interpolator - the interpolator to set
    • getAppender

      public Appender getAppender()
      Returns:
      the appender
    • setAppender

      public void setAppender(Appender appender)
      Parameters:
      appender - the appender to set