diff options
| author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-08 12:41:35 +0100 | 
|---|---|---|
| committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-08 12:41:35 +0100 | 
| commit | 70172e9cf093206082a9d88b23fcf2687058cb68 (patch) | |
| tree | 9d8ef113a3d916f178765c0a9083cde5238982db /core/src | |
| parent | 32c5cbffbb829bf1a8b0aae9bb022ccf0964bf18 (diff) | |
| download | RustAndDust-70172e9cf093206082a9d88b23fcf2687058cb68.zip RustAndDust-70172e9cf093206082a9d88b23fcf2687058cb68.tar.gz | |
Label: support \n
Diffstat (limited to 'core/src')
| -rw-r--r-- | core/src/ch/asynk/tankontank/game/hud/Label.java | 12 | 
1 files 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);      }  } | 
