diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/hud/Patch.java | 28 |
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); + } +} |