diff options
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/Tile.java | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/Tile.java b/core/src/ch/asynk/gdx/boardgame/Tile.java index ae0bb70..5c07866 100644 --- a/core/src/ch/asynk/gdx/boardgame/Tile.java +++ b/core/src/ch/asynk/gdx/boardgame/Tile.java @@ -1,14 +1,40 @@ package ch.asynk.gdx.boardgame; -public class Tile +import com.badlogic.gdx.graphics.g2d.Batch; +import com.badlogic.gdx.graphics.g2d.TextureAtlas; + +import ch.asynk.gdx.boardgame.Overlays; + +public class Tile implements Drawable { + public static TextureAtlas defaultOverlay = null; + public float x; public float y; + private Overlays overlays; public Tile(float x, float y) { this.x = x; this.y = y; + if (defaultOverlay != null) { + this.overlays = new Overlays(defaultOverlay); + this.overlays.centerOn(x, y); + } + } + + @Override public void draw(Batch batch) + { + if (overlays != null) { + overlays.draw(batch); + } + } + + public void enableOverlay(int i, boolean enable) + { + if (overlays != null) { + overlays.enable(i, enable); + } } @Override public String toString() |