From 0460996fd80f041d2d0e3a0ec1ec98be96bc6af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sun, 31 May 2020 11:54:49 +0200 Subject: Positionable : add getCX() and getCY() --- core/src/ch/asynk/gdx/boardgame/Positionable.java | 2 ++ 1 file changed, 2 insertions(+) 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) { -- cgit v1.1-2-g2b99