summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2020-05-31 11:54:49 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2020-05-31 11:54:49 +0200
commit0460996fd80f041d2d0e3a0ec1ec98be96bc6af6 (patch)
tree115135648b40862ded194f6e73bb6a2893ef51c6
parentf30a4ef17f9522722a6dd10b4083e2cec5fd1ca2 (diff)
downloadgdx-boardgame-0460996fd80f041d2d0e3a0ec1ec98be96bc6af6.zip
gdx-boardgame-0460996fd80f041d2d0e3a0ec1ec98be96bc6af6.tar.gz
Positionable : add getCX() and getCY()
-rw-r--r--core/src/ch/asynk/gdx/boardgame/Positionable.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/Positionable.java b/core/src/ch/asynk/gdx/boardgame/Positionable.java
index 53d92f8..36a9cda 100644
--- a/core/src/ch/asynk/gdx/boardgame/Positionable.java
+++ b/core/src/ch/asynk/gdx/boardgame/Positionable.java
@@ -8,6 +8,8 @@ public interface Positionable
public float getHeight();
public void translate(float dx, float dy);
public void setPosition(float x, float y);
+ default public float getCX() { return getX() + (getWidth() / 2f); }
+ default public float getCY() { return getY() + (getHeight() / 2f); }
default public void centerOn(float cx, float cy)
{