summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-01-19 17:24:42 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-01-19 17:24:42 +0100
commitf6b6913a788cef21aab66afe8caecc2ca5e7b24a (patch)
tree40a2e4a9cdc7b6d8aee1c2c5b6f475156c0025a1
parent650e16fcfbb3f77f9a877735a2bc02834af66ed9 (diff)
downloadRustAndDust-f6b6913a788cef21aab66afe8caecc2ca5e7b24a.zip
RustAndDust-f6b6913a788cef21aab66afe8caecc2ca5e7b24a.tar.gz
MenuScreen: pause render and riseze onPause()
-rw-r--r--core/src/ch/asynk/rustanddust/screens/MenuScreen.java10
1 files 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;
}
}