summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/game/hud/Bg.java30
1 files changed, 3 insertions, 27 deletions
diff --git a/core/src/ch/asynk/tankontank/game/hud/Bg.java b/core/src/ch/asynk/tankontank/game/hud/Bg.java
index c88b985..5679d57 100644
--- a/core/src/ch/asynk/tankontank/game/hud/Bg.java
+++ b/core/src/ch/asynk/tankontank/game/hud/Bg.java
@@ -1,35 +1,17 @@
package ch.asynk.tankontank.game.hud;
-import com.badlogic.gdx.utils.Disposable;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
-import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
-import com.badlogic.gdx.math.Rectangle;
-import ch.asynk.tankontank.engine.gfx.Drawable;
-
-public class Bg implements Drawable, Disposable
+public class Bg extends Widget
{
private TextureRegion region;
- protected Rectangle rect;
public Bg(TextureRegion region)
{
+ super();
this.region = region;
- this.rect = new Rectangle(0, 0, 0, 0);
- }
-
- public void set(float x, float y, float w, float h)
- {
- rect.x = x;
- rect.y = y;
- rect.width = w;
- rect.height = h;
- }
-
- public boolean hit(float x, float y)
- {
- return rect.contains(x, y);
+ set(0, 0, region.getRegionWidth(), region.getRegionHeight());
}
@Override
@@ -42,10 +24,4 @@ public class Bg implements Drawable, Disposable
{
batch.draw(region, rect.x, rect.y, rect.width, rect.height);
}
-
- @Override
- public void drawDebug(ShapeRenderer shapes)
- {
- shapes.rect(rect.x, rect.y, rect.width, rect.height);
- }
}