diff options
Diffstat (limited to 'core/src/ch/asynk/gdx/boardgame/Overlays.java')
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/Overlays.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/Overlays.java b/core/src/ch/asynk/gdx/boardgame/Overlays.java index 392d1cd..5746630 100644 --- a/core/src/ch/asynk/gdx/boardgame/Overlays.java +++ b/core/src/ch/asynk/gdx/boardgame/Overlays.java @@ -3,6 +3,7 @@ package ch.asynk.gdx.boardgame; import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.TextureAtlas; +import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.utils.Array; import ch.asynk.gdx.boardgame.Drawable; @@ -120,4 +121,18 @@ public class Overlays implements Drawable, Positionable, Rotable, Scalable } } } + + @Override public void drawDebug(ShapeRenderer shapeRenderer) + { + if (!isEnabled) return; + for (int i = 0, n = sprites.size; i < n; i++) { + if (enabled[i]) { + final Sprite sprite = sprites.get(i); + float w = sprite.getWidth(); + float h = sprite.getHeight(); + shapeRenderer.rect(sprite.getX(), sprite.getY(), (w / 2f), (h / 2f), w, h, sprite.getScaleX(), sprite.getScaleY(), sprite.getRotation()); + return; + } + } + } } |