Package net.dermetfan.gdx
Class Typewriter
java.lang.Object
net.dermetfan.gdx.Typewriter
public class Typewriter
extends java.lang.Object
A Typewriter writing a
Uses a
CharSequence.Uses a
CharSequenceInterpolator and Appender, so Interpolations and custom cursors can be used.-
Constructor Summary
Constructors Constructor Description Typewriter()instantiates aTypewriterusing the default valuesTypewriter(boolean cursorWhileTyping, boolean cursorAfterTyping)instantiates a newTypewriterwith the givencursorWhileTypingandcursorAfterTypingTypewriter(java.lang.CharSequence cursor)instantiates a newTypewriterwith the given cursorTypewriter(java.lang.CharSequence cursor, boolean cursorWhileTyping, boolean cursorAfterTyping)instantiates a newTypewriterwith the given cursor,cursorWhileTypingandcursorAfterTyping -
Method Summary
Modifier and Type Method Description AppendergetAppender()floatgetCharsPerSecond()CharSequenceInterpolatorgetInterpolator()floatgetTime()booleanisCursorAfterTyping()booleanisCursorWhileTyping()voidsetAppender(Appender appender)voidsetCharsPerSecond(float charsPerSecond)voidsetCursorAfterTyping(boolean cursorAfterTyping)voidsetCursorWhileTyping(boolean cursorWhileTyping)voidsetInterpolator(CharSequenceInterpolator interpolator)voidsetTime(float time)java.lang.CharSequencetype(java.lang.CharSequence seq)voidupdate(float delta)updates the time theTypewriterhad to typejava.lang.CharSequenceupdateAndType(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 aTypewriterusing the default values -
Typewriter
public Typewriter(java.lang.CharSequence cursor)instantiates a newTypewriterwith the given cursor -
Typewriter
public Typewriter(boolean cursorWhileTyping, boolean cursorAfterTyping)instantiates a newTypewriterwith the givencursorWhileTypingandcursorAfterTyping -
Typewriter
public Typewriter(java.lang.CharSequence cursor, boolean cursorWhileTyping, boolean cursorAfterTyping)instantiates a newTypewriterwith the given cursor,cursorWhileTypingandcursorAfterTyping- See Also:
Typewriter(boolean, boolean)
-
-
Method Details
-
update
public void update(float delta)updates the time theTypewriterhad to type -
type
public java.lang.CharSequence type(java.lang.CharSequence seq)- Returns:
- the given
CharSequenceas 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() -
setCharsPerSecond
public void setCharsPerSecond(float charsPerSecond) -
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- thecursorWhileTypingto set
-
isCursorAfterTyping
public boolean isCursorAfterTyping()- Returns:
- the
cursorAfterTyping
-
setCursorAfterTyping
public void setCursorAfterTyping(boolean cursorAfterTyping)- Parameters:
cursorAfterTyping- thecursorAfterTypingto set
-
getInterpolator
- Returns:
- the
interpolator
-
setInterpolator
- Parameters:
interpolator- theinterpolatorto set
-
getAppender
- Returns:
- the
appender
-
setAppender
- Parameters:
appender- theappenderto set
-