diff options
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/ui/Bg.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/ui/Bg.java b/core/src/ch/asynk/gdx/boardgame/ui/Bg.java new file mode 100644 index 0000000..18cfa7c --- /dev/null +++ b/core/src/ch/asynk/gdx/boardgame/ui/Bg.java @@ -0,0 +1,22 @@ +package ch.asynk.gdx.boardgame.ui; + +import com.badlogic.gdx.graphics.g2d.Batch; +import com.badlogic.gdx.graphics.g2d.TextureRegion; + +public class Bg extends Element +{ + private TextureRegion region; + + public Bg(TextureRegion region) + { + this.region = region; + rect.set(0, 0, region.getRegionWidth(), region.getRegionHeight()); + } + + @Override public void draw(Batch batch) + { + if (!visible) return; + if (tainted) computeGeometry(); + batch.draw(region, rect.x, rect.y, rect.width, rect.height); + } +} |