From da8fe9c10da9cbe02c7284def0f83392d1c4e0d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sun, 2 Nov 2014 13:04:34 +0100 Subject: Text: add getWidth() getHeight() --- core/src/ch/asynk/tankontank/game/hud/Text.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/src/ch/asynk/tankontank/game/hud/Text.java b/core/src/ch/asynk/tankontank/game/hud/Text.java index e468ccc..0e2e73e 100644 --- a/core/src/ch/asynk/tankontank/game/hud/Text.java +++ b/core/src/ch/asynk/tankontank/game/hud/Text.java @@ -30,6 +30,18 @@ public class Text implements Drawable, Disposable font.dispose(); } + public float getWidth() + { + TextBounds b = font.getBounds(text); + return b.width; + } + + public float getHeight() + { + TextBounds b = font.getBounds(text); + return b.height; + } + public void setPosition(float x, float y) { TextBounds b = font.getBounds(text); -- cgit v1.1-2-g2b99