Closed fgnm closed 5 years ago
I have exactly the same problem.
I've found a small workaround for this. Basically, at the end of act method in TypingLabel class, I check if that method is called for the first time, if yes force a restart() of the label, this seems to fix the issue but I hope that the developer could fix it in a better way..
My TypingLabel class:
public class TypingLabel extends Label {
...
private boolean firstTime = true;
...
@Override
public void act (float delta) {
......
if(firstTime) {
restart();
firstTime = false;
}
}
....
}
Could you please test this? It seems to fix this problem too, but I'm not 100% sure.
protected void saveOriginalText () {
originalText.setLength(0);
originalText.insert(0, this.getText());
originalText.trimToSize();
restart(); // <------ add this
}
Tried but it produce a StackOverflowError, maybe we run different version of the library but in my restart() method I've an invalidate() call, so it cause an infinite loop. I'm using the latest available here on github
In my case, this happens randomly on mobile phones with poor performance when text is displayed for the first time. But I haven't tried the fixes yet cause it's hard to reproduce.
When I start my game for the first time typing labels are showed unreadable as the image above: Here should be written "TAP TO START". I create the label inside constructor of my Scene2D screen:
If I add a
{WAIT}
before jump the problem appear to be solved on some devices, but on others not. So I think that timers and wait are not the right solution of this problem.