diff options
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/Tile.java | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/Tile.java b/core/src/ch/asynk/gdx/boardgame/Tile.java index de53a4e..454f839 100644 --- a/core/src/ch/asynk/gdx/boardgame/Tile.java +++ b/core/src/ch/asynk/gdx/boardgame/Tile.java @@ -19,16 +19,22 @@ public class Tile implements Drawable this.x = x; this.y = y; if (defaultOverlay != null) { - this.overlays = new Overlays(defaultOverlay); - this.overlays.centerOn(x, y); + setOverlay(defaultOverlay); } } - @Override public void draw(Batch batch) + public boolean overlaysEnabled() { if (overlays != null) { - overlays.draw(batch); + return overlays.isEnabled(); } + return false; + } + + public void setOverlay(TextureAtlas textureAtlas) + { + this.overlays = new Overlays(textureAtlas); + this.overlays.centerOn(x, y); } public void enableOverlay(int i, boolean enable) @@ -51,6 +57,13 @@ public class Tile implements Drawable return "[" + x + ", " + y + "]"; } + @Override public void draw(Batch batch) + { + if (overlays != null) { + overlays.draw(batch); + } + } + @Override public void drawDebug(ShapeRenderer shapeRenderer) { if (overlays != null) { |