summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/gdx
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2019-12-18 09:56:48 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2019-12-18 09:56:48 +0100
commit6b46e61ecefb120b186247ac01c6e2afac6337bb (patch)
tree58f5d71f1a764261d5f60aefb7fab10bad626c49 /core/src/ch/asynk/gdx
parent11e02bbeefee419ce722516dfd0a24cf2be47e14 (diff)
downloadgdx-boardgame-6b46e61ecefb120b186247ac01c6e2afac6337bb.zip
gdx-boardgame-6b46e61ecefb120b186247ac01c6e2afac6337bb.tar.gz
UI : add Bg (TextureRegion)
Diffstat (limited to 'core/src/ch/asynk/gdx')
-rw-r--r--core/src/ch/asynk/gdx/boardgame/ui/Bg.java22
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);
+ }
+}