Class Typewriter

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

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

    Constructors
    Constructor Description
    Typewriter()
    instantiates a Typewriter using the default values
    Typewriter​(boolean cursorWhileTyping, boolean cursorAfterTyping)
    instantiates a new Typewriter with the given cursorWhileTyping and cursorAfterTyping
    Typewriter​(java.lang.CharSequence cursor)
    instantiates a new Typewriter with the given cursor
    Typewriter​(java.lang.CharSequence cursor, boolean cursorWhileTyping, boolean cursorAfterTyping)
    instantiates a new Typewriter with the given cursor, cursorWhileTyping and cursorAfterTyping
  • Method Summary

    Modifier and Type Method Description
    Appender getAppender()  
    float getCharsPerSecond()  
    CharSequenceInterpolator getInterpolator()  
    float getTime()  
    boolean isCursorAfterTyping()  
    boolean isCursorWhileTyping()  
    void setAppender​(Appender appender)  
    void setCharsPerSecond​(float charsPerSecond)  
    void setCursorAfterTyping​(boolean cursorAfterTyping)  
    void setCursorWhileTyping​(boolean cursorWhileTyping)  
    void setInterpolator​(CharSequenceInterpolator interpolator)  
    void setTime​(float time)  
    java.lang.CharSequence type​(java.lang.CharSequence seq)  
    void update​(float delta)
    updates the time the Typewriter had to type
    java.lang.CharSequence updateAndType​(java.lang.CharSequence seq, float delta)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Typewriter

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

      public Typewriter​(java.lang.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​(java.lang.CharSequence cursor, boolean cursorWhileTyping, boolean cursorAfterTyping)
      instantiates a new Typewriter with the given cursor, cursorWhileTyping and cursorAfterTyping
      See Also:
      Typewriter(boolean, boolean)
  • Method Details

    • update

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

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

      public java.lang.CharSequence updateAndType​(java.lang.CharSequence seq, float delta)
      See Also:
      update(float), type(CharSequence)
    • getCharsPerSecond

      public float getCharsPerSecond()
      See Also:
      CharSequenceInterpolator.getCharsPerSecond()
    • setCharsPerSecond

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

      public float getTime()
      See Also:
      CharSequenceInterpolator.getTime()
    • setTime

      public void setTime​(float time)
      See Also:
      CharSequenceInterpolator.setTime(float)
    • 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