Package net.dermetfan.gdx
Class Typewriter
java.lang.Object
net.dermetfan.gdx.Typewriter
A Typewriter writing a
Uses a
CharSequence.Uses a
CharSequenceInterpolator and Appender, so Interpolations and custom cursors can be used.-
Constructor Summary
ConstructorsConstructorDescriptioninstantiates aTypewriterusing the default valuesTypewriter(boolean cursorWhileTyping, boolean cursorAfterTyping) instantiates a newTypewriterwith the givencursorWhileTypingandcursorAfterTypingTypewriter(CharSequence cursor) instantiates a newTypewriterwith the given cursorTypewriter(CharSequence cursor, boolean cursorWhileTyping, boolean cursorAfterTyping) instantiates a newTypewriterwith the given cursor,cursorWhileTypingandcursorAfterTyping -
Method Summary
Modifier and TypeMethodDescriptionfloatfloatgetTime()booleanbooleanvoidsetAppender(Appender appender) voidsetCharsPerSecond(float charsPerSecond) voidsetCursorAfterTyping(boolean cursorAfterTyping) voidsetCursorWhileTyping(boolean cursorWhileTyping) voidsetInterpolator(CharSequenceInterpolator interpolator) voidsetTime(float time) type(CharSequence seq) voidupdate(float delta) updates the time theTypewriterhad to typeupdateAndType(CharSequence seq, float delta)
-
Constructor Details
-
Typewriter
public Typewriter()instantiates aTypewriterusing the default values -
Typewriter
instantiates a newTypewriterwith the given cursor -
Typewriter
public Typewriter(boolean cursorWhileTyping, boolean cursorAfterTyping) instantiates a newTypewriterwith the givencursorWhileTypingandcursorAfterTyping -
Typewriter
instantiates a newTypewriterwith the given cursor,cursorWhileTypingandcursorAfterTyping- See Also:
-
-
Method Details
-
update
public void update(float delta) updates the time theTypewriterhad to type -
type
- Returns:
- the given
CharSequenceas far is it could be typed, with or without cursor
-
updateAndType
- 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- 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
-