rafaskb/typing-label

next line bug

TypeOverride opened this issue · 2 comments

i have the problem, that on "next line - \n" it is stopped for some time each new line. Furthermore the first letter on the next line is shown and after that it runs forward again.

Ive seen in the example you always make a space each line to prevent this. This is a workaround off course, but how can i fix the short pause each line?

Here is my input text and a video to show how it looks:
String text = "ABCDEFGHIJKLMNOPQRSTUVWXYZ\n0123456789\nabcdefghijklmnopqrstuvwxyz\n!?.,";
https://www.youtube.com/watch?v=fPqUB5cO3p0

(and the example demo is not working as expected. There is behind most appends of the stringbuilder a \n missing)

SOLVED:
This is a workaround:
TypingConfig.INTERVAL_MULTIPLIERS_BY_CHAR.put('\n', 0);

Hello TypeOverride,

As you already noticed, you can change the char intervals via TypingConfig :)
The default values can be seen here: https://github.com/rafaskb/typing-label/blob/master/src/main/java/com/rafaskoberg/gdx/typinglabel/TypingConfig.java#L40-L50
By default the new line character has a interval multiplier of 20, that multiplied by the DEFAULT_SPEED_PER_CHAR value in the same class results in a pause of 0.7 seconds.

As for the first character issue, that is indeed a bug I intend to fix at some point, possibly when I begin implementing complex dialogues in my own game using TypingLabel. The space as first character solves other problems too, for example a LibGDX bug with Markup Colors causing the spaces to have wrong values, so I'd suggest always having an empty at the beginning of each line for now.