diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2020-06-01 22:24:41 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2020-06-01 22:24:41 +0200 |
commit | 842d1182857f7dd9ffc7f8bf6252100ae1199c06 (patch) | |
tree | 60b8922ccc405e1ace532f918153feb4baaceff0 /core/src/ch/asynk/gdx/boardgame/Tile.java | |
parent | 1a9d984f25b07a5c45484825274c177ea39bc1c3 (diff) | |
download | gdx-boardgame-842d1182857f7dd9ffc7f8bf6252100ae1199c06.zip gdx-boardgame-842d1182857f7dd9ffc7f8bf6252100ae1199c06.tar.gz |
Tile : float x,y->cx,cy, add int x,y
Diffstat (limited to 'core/src/ch/asynk/gdx/boardgame/Tile.java')
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/Tile.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/Tile.java b/core/src/ch/asynk/gdx/boardgame/Tile.java index 454f839..504a82d 100644 --- a/core/src/ch/asynk/gdx/boardgame/Tile.java +++ b/core/src/ch/asynk/gdx/boardgame/Tile.java @@ -10,14 +10,18 @@ public class Tile implements Drawable { public static TextureAtlas defaultOverlay = null; - public float x; - public float y; + public int x; + public int y; + public float cx; + public float cy; private Overlays overlays; - public Tile(float x, float y) + public Tile(int x, int y, float cx, float cy) { this.x = x; this.y = y; + this.cx = cx; + this.cy = cy; if (defaultOverlay != null) { setOverlay(defaultOverlay); } @@ -34,7 +38,7 @@ public class Tile implements Drawable public void setOverlay(TextureAtlas textureAtlas) { this.overlays = new Overlays(textureAtlas); - this.overlays.centerOn(x, y); + this.overlays.centerOn(cx, cy); } public void enableOverlay(int i, boolean enable) @@ -54,7 +58,7 @@ public class Tile implements Drawable @Override public String toString() { - return "[" + x + ", " + y + "]"; + return "[" + x + ", " + y + "] => [" + cx + "," + cy + "]"; } @Override public void draw(Batch batch) |