diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-09 00:37:30 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-09 00:37:30 +0100 |
commit | 373d2bc17718cd7279a52fe80ea3d412d107f697 (patch) | |
tree | e90c37b03c4dd30af16ea8c523e518eb3e743393 /core/src/ch/asynk | |
parent | dab9edaee6efd4cf0c66fd2a43d6d3bb0d735316 (diff) | |
download | RustAndDust-373d2bc17718cd7279a52fe80ea3d412d107f697.zip RustAndDust-373d2bc17718cd7279a52fe80ea3d412d107f697.tar.gz |
Bg: extends Widget
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/hud/Bg.java | 30 |
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); - } } |