diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2019-12-17 15:27:31 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2019-12-17 15:27:31 +0100 |
commit | 36d827659b54b04c90722eb2e431f622b33c047c (patch) | |
tree | e85318a824cfcb1d70bf8019fc08f6732f01fc3b /core/src/ch/asynk/gdx/boardgame/ui | |
parent | 142475696bc89c62e3457c9fef6bf37e4f0e3699 (diff) | |
download | gdx-boardgame-36d827659b54b04c90722eb2e431f622b33c047c.zip gdx-boardgame-36d827659b54b04c90722eb2e431f622b33c047c.tar.gz |
UI : add drawDebug(…) to Menu, normalize var names
Diffstat (limited to 'core/src/ch/asynk/gdx/boardgame/ui')
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/ui/Assembly.java | 4 | ||||
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/ui/Button.java | 6 | ||||
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/ui/Element.java | 4 | ||||
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/ui/Menu.java | 10 |
4 files changed, 17 insertions, 7 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/ui/Assembly.java b/core/src/ch/asynk/gdx/boardgame/ui/Assembly.java index 8925032..6754518 100644 --- a/core/src/ch/asynk/gdx/boardgame/ui/Assembly.java +++ b/core/src/ch/asynk/gdx/boardgame/ui/Assembly.java @@ -56,8 +56,8 @@ public abstract class Assembly extends Element children.forEach( c -> c.draw(batch) ); } - @Override public void drawDebug(ShapeRenderer debugShapes) + @Override public void drawDebug(ShapeRenderer shapeRenderer) { - children.forEach( c -> c.drawDebug(debugShapes) ); + children.forEach( c -> c.drawDebug(shapeRenderer) ); } } diff --git a/core/src/ch/asynk/gdx/boardgame/ui/Button.java b/core/src/ch/asynk/gdx/boardgame/ui/Button.java index e33ee07..c19eab1 100644 --- a/core/src/ch/asynk/gdx/boardgame/ui/Button.java +++ b/core/src/ch/asynk/gdx/boardgame/ui/Button.java @@ -58,9 +58,9 @@ public class Button extends Patch label.draw(batch); } - @Override public void drawDebug(ShapeRenderer debugShapes) + @Override public void drawDebug(ShapeRenderer shapeRenderer) { - super.drawDebug(debugShapes); - label.drawDebug(debugShapes); + super.drawDebug(shapeRenderer); + label.drawDebug(shapeRenderer); } } diff --git a/core/src/ch/asynk/gdx/boardgame/ui/Element.java b/core/src/ch/asynk/gdx/boardgame/ui/Element.java index e24498b..2fe9f89 100644 --- a/core/src/ch/asynk/gdx/boardgame/ui/Element.java +++ b/core/src/ch/asynk/gdx/boardgame/ui/Element.java @@ -48,9 +48,9 @@ public abstract class Element implements Drawable, Paddable, Positionable, Touch @Override public final float getInnerWidth() { return rect.width - 2 * padding; } @Override public final float getInnerHeight() { return rect.height - 2 * padding; } - @Override public void drawDebug(ShapeRenderer debugShapes) + @Override public void drawDebug(ShapeRenderer shapeRenderer) { - debugShapes.rect(getX(), getY(), getWidth(), getHeight()); + shapeRenderer.rect(getX(), getY(), getWidth(), getHeight()); } @Override public boolean touch(float x, float y) diff --git a/core/src/ch/asynk/gdx/boardgame/ui/Menu.java b/core/src/ch/asynk/gdx/boardgame/ui/Menu.java index 243b000..93309ab 100644 --- a/core/src/ch/asynk/gdx/boardgame/ui/Menu.java +++ b/core/src/ch/asynk/gdx/boardgame/ui/Menu.java @@ -3,6 +3,7 @@ package ch.asynk.gdx.boardgame.ui; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.NinePatch; import com.badlogic.gdx.graphics.g2d.BitmapFont; +import com.badlogic.gdx.graphics.glutils.ShapeRenderer; public class Menu extends Patch { @@ -121,4 +122,13 @@ public class Menu extends Patch label.draw(batch); } } + + @Override public void drawDebug(ShapeRenderer shapeRenderer) + { + super.drawDebug(shapeRenderer); + title.drawDebug(shapeRenderer); + for (Label label : entries) { + label.drawDebug(shapeRenderer); + } + } } |