I've implemented my own TypeWriter for text that looks like this
public static String GetWords(String text, float wordCount)
{
float words = wordCount;
// loop through each character in text
for (int i = 0; i < text.length(); i++)
{
if(i == text.length() - 1 && SceneHandler.lineFinished == false){
SceneHandler.lineFinished = true;
}
words--;
if (words <= 0)
{
return text.substring(0, i);
}
}
return text;
}
I decided I wanted to do markup as well, so that means color codes and such. Problem is that the TypeWriter also goes through the color code (The [COLOR] and the [] part) so you get something like this
[
[Y
[YE
[YEL
[YELL
[YELLO
[YELLOW
*nothing*
(Actually yellow) T
Does anybody have any idea how I could fix this or approach this problem?