summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/gdx/boardgame/Piece.java
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2019-12-17 16:22:28 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2019-12-17 16:22:28 +0100
commitbc6b9374d9eb228bbc3d66ed6f77ea4e6ff084fe (patch)
tree829e1f7b008c5262e4dd777015732582e26009c4 /core/src/ch/asynk/gdx/boardgame/Piece.java
parent36d827659b54b04c90722eb2e431f622b33c047c (diff)
downloadgdx-boardgame-bc6b9374d9eb228bbc3d66ed6f77ea4e6ff084fe.zip
gdx-boardgame-bc6b9374d9eb228bbc3d66ed6f77ea4e6ff084fe.tar.gz
core : implement drawDebug(ShapeRenderer)
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());
+ }
}