use of com.agorria.shootandmove.menu.SlowTextElement in project ShootAndRun by IonAgorria.
the class GameUI method showText.
/**
* Shows text in UI
*/
void showText(String text) {
if (text != null) {
List<String> lines = Arrays.asList(Utilities.getTextLines(text));
if (slowTextElement == null) {
slowTextElement = new SlowTextElement(new Rectangle(aspect * 0.3f, 0.0f, aspect * 0.4f, 0.5f), lines, () -> showText(null), true, false);
slowTextElement.onOpen();
} else if (!text.equals(lastText)) {
slowTextElement.setLines(lines);
}
} else {
slowTextElement = null;
}
lastText = text;
}
Aggregations