From f6b6913a788cef21aab66afe8caecc2ca5e7b24a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 19 Jan 2016 17:24:42 +0100 Subject: MenuScreen: pause render and riseze onPause() --- core/src/ch/asynk/rustanddust/screens/MenuScreen.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/screens/MenuScreen.java b/core/src/ch/asynk/rustanddust/screens/MenuScreen.java index ce90293..8c475ff 100644 --- a/core/src/ch/asynk/rustanddust/screens/MenuScreen.java +++ b/core/src/ch/asynk/rustanddust/screens/MenuScreen.java @@ -37,6 +37,7 @@ public class MenuScreen implements Screen private int n = xPath.length; + private boolean paused; private boolean ready; private boolean gameAssetsLoading; private Texture bg; @@ -68,6 +69,7 @@ public class MenuScreen implements Screen this.camera = new MenuCamera(V_CENTER_X, V_CENTER_Y, V_WIDTH, V_HEIGHT, game.hudCorrection); + this.paused = false; this.gameAssetsLoading = false; this.bg = game.manager.get(game.PNG_MAP_00, Texture.class); @@ -150,6 +152,8 @@ public class MenuScreen implements Screen @Override public void render(float delta) { + if (paused) return; + float x = xPath[0]; float y = yPath[0]; if (gameAssetsLoading) { @@ -222,6 +226,8 @@ public class MenuScreen implements Screen @Override public void resize(int width, int height) { + if (paused) return; + update(width, height); } @@ -252,12 +258,12 @@ public class MenuScreen implements Screen @Override public void pause() { - // RustAndDust.debug("MenuScreen", "pause()"); + paused = true; } @Override public void resume() { - // RustAndDust.debug("MenuScreen", "resume()"); + paused = false; } } -- cgit v1.1-2-g2b99