summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/gdx/boardgame/Piece.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk/gdx/boardgame/Piece.java')
-rw-r--r--core/src/ch/asynk/gdx/boardgame/Piece.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/Piece.java b/core/src/ch/asynk/gdx/boardgame/Piece.java
index 5008d9a..275ea58 100644
--- a/core/src/ch/asynk/gdx/boardgame/Piece.java
+++ b/core/src/ch/asynk/gdx/boardgame/Piece.java
@@ -4,6 +4,7 @@ import java.lang.Math;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
+import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.MathUtils;
@@ -69,4 +70,11 @@ public class Piece extends Sprite implements Drawable, Positionable, Rotable, Sc
{
v.set(getX()+ (getWidth() / 2f), getY() + (getHeight() / 2f));
}
+
+ @Override public void drawDebug(ShapeRenderer shapeRenderer)
+ {
+ float w = getWidth();
+ float h = getHeight();
+ shapeRenderer.rect(getX(), getY(), (w / 2f), (h / 2f), w, h, getScaleX(), getScaleY(), getRotation());
+ }
}