List of usage examples for com.badlogic.gdx.graphics.g2d BitmapFont computeVisibleGlyphs
public int computeVisibleGlyphs(CharSequence str, int start, int end, float availableWidth)
From source file:org.matheusdev.ror.screens.ScreenGameMap.java
License:Open Source License
private Stack<String> splitIntoLinesRec(Stack<String> list, String line, BitmapFont font, float width) { int visible = font.computeVisibleGlyphs(line, 0, line.length(), width); if (line.length() > visible) { String head = line.substring(0, visible - 1); String rest = line.substring(visible, line.length() - 1); list.push(head);//from w w w . ja va 2 s .c om return splitIntoLinesRec(list, rest, font, width); } else { list.push(line); return list; } }