summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/game
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-02 13:04:34 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-02 13:04:34 +0100
commitda8fe9c10da9cbe02c7284def0f83392d1c4e0d0 (patch)
treeb68bbd82221d94c55d109577ff2835871189b353 /core/src/ch/asynk/tankontank/game
parentfd4d4343786422809157e0959f44121fce1a96cc (diff)
downloadRustAndDust-da8fe9c10da9cbe02c7284def0f83392d1c4e0d0.zip
RustAndDust-da8fe9c10da9cbe02c7284def0f83392d1c4e0d0.tar.gz
Text: add getWidth() getHeight()
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
-rw-r--r--core/src/ch/asynk/tankontank/game/hud/Text.java12
1 files changed, 12 insertions, 0 deletions
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);