diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-05-13 12:02:02 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-05-13 12:02:02 +0200 |
commit | 65c68c16cfe0795b3539d864ec85a2e553cee99a (patch) | |
tree | 75993fb08dc0916536167dc4acc2ff6aa5b38a82 /core/src/ch | |
parent | 9d75395bd0cd284a3d01d07db7bd4fe3642acbce (diff) | |
download | RustAndDust-65c68c16cfe0795b3539d864ec85a2e553cee99a.zip RustAndDust-65c68c16cfe0795b3539d864ec85a2e553cee99a.tar.gz |
StackedImages: drawDebug() do not draw rect if no overlay is active
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/rustanddust/engine/gfx/StackedImages.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/gfx/StackedImages.java b/core/src/ch/asynk/rustanddust/engine/gfx/StackedImages.java index 325eb56..1e1dbcf 100644 --- a/core/src/ch/asynk/rustanddust/engine/gfx/StackedImages.java +++ b/core/src/ch/asynk/rustanddust/engine/gfx/StackedImages.java @@ -97,9 +97,14 @@ public class StackedImages implements Drawable, Disposable @Override public void drawDebug(ShapeRenderer shapes) { - Sprite sprite = sprites.get(0); - float w = sprite.getWidth(); - float h = sprite.getHeight(); - shapes.rect(sprite.getX(), sprite.getY(), (w / 2f), (h / 2f), w, h, sprite.getScaleX(), sprite.getScaleY(), sprite.getRotation()); + for (int i = 0, n = sprites.size; i < n; i++) { + if (enabled[i]) { + Sprite sprite = sprites.get(0); + float w = sprite.getWidth(); + float h = sprite.getHeight(); + shapes.rect(sprite.getX(), sprite.getY(), (w / 2f), (h / 2f), w, h, sprite.getScaleX(), sprite.getScaleY(), sprite.getRotation()); + return; + } + } } } |