From 70172e9cf093206082a9d88b23fcf2687058cb68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sat, 8 Nov 2014 12:41:35 +0100 Subject: Label: support \n --- core/src/ch/asynk/tankontank/game/hud/Label.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/ch/asynk/tankontank/game/hud/Label.java b/core/src/ch/asynk/tankontank/game/hud/Label.java index a0ada50..e3f753f 100644 --- a/core/src/ch/asynk/tankontank/game/hud/Label.java +++ b/core/src/ch/asynk/tankontank/game/hud/Label.java @@ -32,19 +32,19 @@ public class Label implements Drawable, Disposable public float getWidth() { - TextBounds b = font.getBounds(text); + TextBounds b = getBounds(); return b.width; } public float getHeight() { - TextBounds b = font.getBounds(text); + TextBounds b = getBounds(); return b.height; } public void setPosition(float x, float y) { - TextBounds b = font.getBounds(text); + TextBounds b = getBounds(); this.x = x; this.y = y; this.ry = (y + b.height); @@ -52,7 +52,7 @@ public class Label implements Drawable, Disposable public TextBounds getBounds() { - return font.getBounds(text); + return font.getMultiLineBounds(text); } public void write(String text) @@ -70,14 +70,14 @@ public class Label implements Drawable, Disposable public void draw(Batch batch) { if (!visible) return; - font.draw(batch, text, x, ry); + font.drawMultiLine(batch, text, x, ry); } @Override public void drawDebug(ShapeRenderer shapes) { if (!visible) return; - TextBounds b = font.getBounds(text); + TextBounds b = getBounds(); shapes.rect(x, y, b.width, b.height); } } -- cgit v1.1-2-g2b99