summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/gdx/boardgame/FramedSprite.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk/gdx/boardgame/FramedSprite.java')
-rw-r--r--core/src/ch/asynk/gdx/boardgame/FramedSprite.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/FramedSprite.java b/core/src/ch/asynk/gdx/boardgame/FramedSprite.java
index 1f60f9c..8fc2e80 100644
--- a/core/src/ch/asynk/gdx/boardgame/FramedSprite.java
+++ b/core/src/ch/asynk/gdx/boardgame/FramedSprite.java
@@ -3,6 +3,7 @@ package ch.asynk.gdx.boardgame;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
+import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
public class FramedSprite implements Drawable, Positionable
{
@@ -101,4 +102,18 @@ public class FramedSprite implements Drawable, Positionable
{
batch.draw(frame, x, y, 0, 0, frame.getRegionWidth(), frame.getRegionHeight(), 1f, 1f, r);
}
+
+ @Override public void drawDebug(ShapeRenderer shapeRenderer)
+ {
+ shapeRenderer.end();
+ shapeRenderer.begin(ShapeRenderer.ShapeType.Line);
+ shapeRenderer.identity();
+ shapeRenderer.translate(x, y, 0);
+ shapeRenderer.rotate(0, 0, 1, r);
+ shapeRenderer.translate(-x, -y, 0);
+ shapeRenderer.rect(x, y, frame.getRegionWidth(), frame.getRegionHeight());
+ shapeRenderer.end();
+ shapeRenderer.begin(ShapeRenderer.ShapeType.Line);
+ shapeRenderer.identity();
+ }
}