diff options
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/ui/Assembly.java | 11 | ||||
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/ui/Element.java | 12 |
2 files changed, 11 insertions, 12 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/ui/Assembly.java b/core/src/ch/asynk/gdx/boardgame/ui/Assembly.java index 28a7597..b2c2cec 100644 --- a/core/src/ch/asynk/gdx/boardgame/ui/Assembly.java +++ b/core/src/ch/asynk/gdx/boardgame/ui/Assembly.java @@ -46,15 +46,4 @@ public abstract class Assembly extends Element } return false; } - - @Override public void draw(Batch batch) - { - if (tainted) computeGeometry(); - children.forEach( c -> c.draw(batch) ); - } - - @Override public void drawDebug(ShapeRenderer shapeRenderer) - { - children.forEach( c -> c.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 73d068f..5e28c1d 100644 --- a/core/src/ch/asynk/gdx/boardgame/ui/Element.java +++ b/core/src/ch/asynk/gdx/boardgame/ui/Element.java @@ -1,5 +1,6 @@ package ch.asynk.gdx.boardgame.ui; +import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import com.badlogic.gdx.math.Rectangle; @@ -9,7 +10,7 @@ import ch.asynk.gdx.boardgame.Positionable; import ch.asynk.gdx.boardgame.Touchable; import ch.asynk.gdx.boardgame.utils.IterableSet; -public abstract class Element implements Drawable, Paddable, Positionable, Touchable +public class Element implements Drawable, Paddable, Positionable, Touchable { public static boolean DEBUG_GEOMETRY = false; public static int DEFAULT_CHILD_COUNT = 2; @@ -99,9 +100,18 @@ public abstract class Element implements Drawable, Paddable, Positionable, Touch } } + + @Override public void draw(Batch batch) + { + if (tainted) computeGeometry(); + children.forEach( c -> c.draw(batch) ); + } + @Override public void drawDebug(ShapeRenderer shapeRenderer) { shapeRenderer.rect(getX(), getY(), getWidth(), getHeight()); + if (children != null) + children.forEach( c -> c.drawDebug(shapeRenderer) ); } @Override public boolean touch(float x, float y) |