diff options
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/Scalable.java | 1 | ||||
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/pieces/Overlays.java | 5 | ||||
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/pieces/Piece.java | 5 |
3 files changed, 11 insertions, 0 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/Scalable.java b/core/src/ch/asynk/gdx/boardgame/Scalable.java index 3cf63be..7e31f9f 100644 --- a/core/src/ch/asynk/gdx/boardgame/Scalable.java +++ b/core/src/ch/asynk/gdx/boardgame/Scalable.java @@ -2,5 +2,6 @@ package ch.asynk.gdx.boardgame; public interface Scalable { + public float getScale(); public void setScale(float scale); } diff --git a/core/src/ch/asynk/gdx/boardgame/pieces/Overlays.java b/core/src/ch/asynk/gdx/boardgame/pieces/Overlays.java index 864c778..387090a 100644 --- a/core/src/ch/asynk/gdx/boardgame/pieces/Overlays.java +++ b/core/src/ch/asynk/gdx/boardgame/pieces/Overlays.java @@ -88,6 +88,11 @@ public class Overlays implements Drawable, Positionable, Rotable, Scalable } } + @Override public float getScale() + { + return sprites.get(0).getScaleX(); + } + @Override public void setScale(float scale) { for (Sprite sprite : sprites) { diff --git a/core/src/ch/asynk/gdx/boardgame/pieces/Piece.java b/core/src/ch/asynk/gdx/boardgame/pieces/Piece.java index 3c99ca4..e896ea6 100644 --- a/core/src/ch/asynk/gdx/boardgame/pieces/Piece.java +++ b/core/src/ch/asynk/gdx/boardgame/pieces/Piece.java @@ -15,6 +15,11 @@ public class Piece extends Sprite implements Drawable, Positionable, Rotable, Sc super(texture); } + @Override public float getScale() + { + return getScaleX(); + } + @Override public void centerOn(float cx, float cy) { setPosition((cx - (getWidth() / 2f)), (cy - (getHeight() / 2f))); |