summaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
Diffstat (limited to 'test/src')
-rw-r--r--test/src/ch/asynk/gdx/tabletop/test/BoardScreen.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/src/ch/asynk/gdx/tabletop/test/BoardScreen.java b/test/src/ch/asynk/gdx/tabletop/test/BoardScreen.java
index 8e605bf..d452ba4 100644
--- a/test/src/ch/asynk/gdx/tabletop/test/BoardScreen.java
+++ b/test/src/ch/asynk/gdx/tabletop/test/BoardScreen.java
@@ -9,7 +9,9 @@ import com.badlogic.gdx.math.Vector2;
import ch.asynk.gdx.tabletop.Camera;
import ch.asynk.gdx.tabletop.Board;
import ch.asynk.gdx.tabletop.board.BoardFactory;
+import ch.asynk.gdx.tabletop.ui.Alignment;
import ch.asynk.gdx.tabletop.ui.Button;
+import ch.asynk.gdx.tabletop.ui.Root;
public class BoardScreen extends AbstractScreen
{
@@ -138,6 +140,7 @@ public class BoardScreen extends AbstractScreen
private Camera cam;
private MyBoard board;
private Button btn;
+ private Root root;
public BoardScreen(final GdxBoardTest app)
{
@@ -152,7 +155,11 @@ public class BoardScreen extends AbstractScreen
app.assets.getFont(app.assets.FONT_25),
app.assets.getNinePatch(app.assets.PATCH, 23, 23, 23 ,23),
15);
+ this.btn.setAlignment(Alignment.BOTTOM_RIGHT);
this.btn.write("next");
+ this.root = new Root(1);
+ this.root.add(btn);
+ this.root.setPadding(5);
setState(State.HEX_V);
}
@@ -179,7 +186,7 @@ public class BoardScreen extends AbstractScreen
cam.applyHudViewport();
batch.setProjectionMatrix(cam.getHudMatrix());
batch.begin();
- btn.draw(batch);
+ root.draw(batch);
batch.end();
}
@@ -187,6 +194,7 @@ public class BoardScreen extends AbstractScreen
{
GdxBoardTest.debug("BoardScrean", String.format("resize (%d,%d)",width, height));
cam.updateViewport(width, height);
+ root.resize(cam.getHud());
}
@Override protected void onDragged(int dx, int dy)