summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2018-10-11 15:03:39 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2018-10-11 15:03:39 +0200
commitf13fd322aec790641cd61be3b009d4ae8154e67e (patch)
tree4c8e326bac42931ceecc6fb5e2053b55fad2457f /core
parentbf2c979fb10485032aa52ebc1ab9b6f5fd690100 (diff)
downloadgdx-boardgame-f13fd322aec790641cd61be3b009d4ae8154e67e.zip
gdx-boardgame-f13fd322aec790641cd61be3b009d4ae8154e67e.tar.gz
Scalable : add float gitScale()
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/gdx/boardgame/Scalable.java1
-rw-r--r--core/src/ch/asynk/gdx/boardgame/pieces/Overlays.java5
-rw-r--r--core/src/ch/asynk/gdx/boardgame/pieces/Piece.java5
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)));