summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/tankontank/game/hud/Patch.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/hud/Patch.java b/core/src/ch/asynk/tankontank/game/hud/Patch.java
new file mode 100644
index 0000000..d5b6caa
--- /dev/null
+++ b/core/src/ch/asynk/tankontank/game/hud/Patch.java
@@ -0,0 +1,28 @@
+package ch.asynk.tankontank.game.hud;
+
+import com.badlogic.gdx.graphics.g2d.Batch;
+import com.badlogic.gdx.graphics.g2d.NinePatch;
+
+public class Patch extends Widget
+{
+ private NinePatch patch;
+
+ public Patch(NinePatch patch)
+ {
+ super();
+ this.patch = patch;
+ set(0, 0, patch.getTotalWidth(), patch.getTotalHeight());
+ }
+
+ @Override
+ public void dispose()
+ {
+ }
+
+ @Override
+ public void draw(Batch batch)
+ {
+ if (!visible) return;
+ patch.draw(batch, rect.x, rect.y, rect.width, rect.height);
+ }
+}