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 aTypewriter
using the default valuesTypewriter(boolean cursorWhileTyping, boolean cursorAfterTyping)
instantiates a newTypewriter
with the givencursorWhileTyping
andcursorAfterTyping
Typewriter(java.lang.CharSequence cursor)
instantiates a newTypewriter
with the given cursorTypewriter(java.lang.CharSequence cursor, boolean cursorWhileTyping, boolean cursorAfterTyping)
instantiates a newTypewriter
with the given cursor,cursorWhileTyping
andcursorAfterTyping
-
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 theTypewriter
had to typejava.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 aTypewriter
using the default values -
Typewriter
public Typewriter(java.lang.CharSequence cursor)instantiates a newTypewriter
with the given cursor -
Typewriter
public Typewriter(boolean cursorWhileTyping, boolean cursorAfterTyping)instantiates a newTypewriter
with the givencursorWhileTyping
andcursorAfterTyping
-
Typewriter
public Typewriter(java.lang.CharSequence cursor, boolean cursorWhileTyping, boolean cursorAfterTyping)instantiates a newTypewriter
with the given cursor,cursorWhileTyping
andcursorAfterTyping
- See Also:
Typewriter(boolean, boolean)
-
-
Method Details
-
update
public void update(float delta)updates the time theTypewriter
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() -
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
- thecursorWhileTyping
to set
-
isCursorAfterTyping
public boolean isCursorAfterTyping()- Returns:
- the
cursorAfterTyping
-
setCursorAfterTyping
public void setCursorAfterTyping(boolean cursorAfterTyping)- Parameters:
cursorAfterTyping
- thecursorAfterTyping
to set
-
getInterpolator
- Returns:
- the
interpolator
-
setInterpolator
- Parameters:
interpolator
- theinterpolator
to set
-
getAppender
- Returns:
- the
appender
-
setAppender
- Parameters:
appender
- theappender
to set
-