Print string char by char (slowmotion)

Hey Guys,



has anyone a idea how to print my string char by char in slowmotion with the effect that it looks like someone is writing the text char by char or my old computer is translating my Morse code with delay between the chars…



Thanks

Just append a char every once in a while?



What’s your exact problem with creating the effect?

i don’t know what you using, bitmapText or nifty, or w/e so i’ll keep it general



[java]

private float counter = 0;

private final float TIME_DELAY = 0.3f; //seconds



simpleUpdate(float tpf) {



counter += tpf;



if(counter >= TIME_DELAY) {

printNextChar();

counter = 0;

}



private void printNextChar() {

text.append(char);

}



}[/java]

2 Likes

yeah i want to append append a char every once in a while! I am using bitmapText.



I don´t know how to create a delay in jME expect by using threadsfunctions… but i dont want to stop my application!

It’s pretty trivial really. See wezrule’s answer…

yeah, wezrule made it for you, you only need create “printNextChar()” where it will choose next chars.

thanks… it works well… i was a brainfucked with float tpf!