diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-02 13:04:34 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-02 13:04:34 +0100 |
commit | da8fe9c10da9cbe02c7284def0f83392d1c4e0d0 (patch) | |
tree | b68bbd82221d94c55d109577ff2835871189b353 /core/src/ch/asynk/tankontank | |
parent | fd4d4343786422809157e0959f44121fce1a96cc (diff) | |
download | RustAndDust-da8fe9c10da9cbe02c7284def0f83392d1c4e0d0.zip RustAndDust-da8fe9c10da9cbe02c7284def0f83392d1c4e0d0.tar.gz |
Text: add getWidth() getHeight()
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/hud/Text.java | 12 |
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); |