I am following the answer here: How get a string width in Libgdx?
The problem I am having is that the getBounds doesn't seem to return to correct width. My code below should place dots after the end of the string, but you can see dots bleeding through some of the text. How do I get correct width of the text?
for (HighScore s : this.scoresData){
font.draw(batch, s.name, x, y);
TextBounds nameBounds = font.getBounds(s.name);
font.draw(batch, s.value, (float) (KineticAssaultMain.WIDTH / 1.5f), y);
for (float i = (nameBounds.width + x); i < ((float)Screen.WIDTH / 1.5f);){
TextBounds dot = font.draw(batch, ".", i, y);
i += dot.width;
}
// go to the next line
y -= 32;
}