summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/gdx/boardgame/Positionable.java
blob: 53d92f83295da4b37e2f01a78019b55cd5fa2539 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package ch.asynk.gdx.boardgame;

public interface Positionable
{
    public float getX();
    public float getY();
    public float getWidth();
    public float getHeight();
    public void translate(float dx, float dy);
    public void setPosition(float x, float y);

    default public void centerOn(float cx, float cy)
    {
        setPosition((cx - (getWidth() / 2f)), (cy - (getHeight() / 2f)));
    }
}