From d15476388238f178e0062b50292a27f2984661a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 18 Dec 2019 23:12:35 +0100 Subject: UiScreen : set ui.Scissors ready --- test/src/ch/asynk/gdx/boardgame/test/AbstractScreen.java | 2 ++ test/src/ch/asynk/gdx/boardgame/test/UiScreen.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/test/src/ch/asynk/gdx/boardgame/test/AbstractScreen.java b/test/src/ch/asynk/gdx/boardgame/test/AbstractScreen.java index 1c1273a..4c51780 100644 --- a/test/src/ch/asynk/gdx/boardgame/test/AbstractScreen.java +++ b/test/src/ch/asynk/gdx/boardgame/test/AbstractScreen.java @@ -17,6 +17,7 @@ import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.math.Vector3; import ch.asynk.gdx.boardgame.ui.Root; +import ch.asynk.gdx.boardgame.ui.Scissors; public abstract class AbstractScreen implements Screen { @@ -106,6 +107,7 @@ public abstract class AbstractScreen implements Screen { GdxBoardTest.debug(dom, "dispose()"); batch.dispose(); + Scissors.clear(); } @Override public void show() diff --git a/test/src/ch/asynk/gdx/boardgame/test/UiScreen.java b/test/src/ch/asynk/gdx/boardgame/test/UiScreen.java index 6ce119e..cb5d164 100644 --- a/test/src/ch/asynk/gdx/boardgame/test/UiScreen.java +++ b/test/src/ch/asynk/gdx/boardgame/test/UiScreen.java @@ -13,6 +13,7 @@ import ch.asynk.gdx.boardgame.ui.Button; import ch.asynk.gdx.boardgame.ui.Label; import ch.asynk.gdx.boardgame.ui.List; import ch.asynk.gdx.boardgame.ui.Patch; +import ch.asynk.gdx.boardgame.ui.Scissors; import ch.asynk.gdx.boardgame.utils.Collection; import ch.asynk.gdx.boardgame.utils.IterableArray; @@ -68,6 +69,7 @@ public class UiScreen extends AbstractScreen this.camera = new OrthographicCamera(); this.camera.position.set(bg.getWidth() / 2f, bg.getHeight() / 2f, 0); setState(State.POSITIONS); + Scissors.register(this.camera, this.batch); } private Button buildButton(BitmapFont font, NinePatch patch, int padding, int spacing, Alignment a, Alignment la) -- cgit v1.1-2-g2b99