endre neste screen etter du trykker på powerdown knappen

This commit is contained in:
Tobydrama 2020-03-31 15:07:23 +02:00
parent 1ded5fa8b2
commit d8c6a8e04c

View File

@ -20,6 +20,7 @@ public class PowerDownScreen implements Screen {
private long startTime; private long startTime;
private final int applicationWidth = 600; private final int applicationWidth = 600;
private final int applicationHeight = 800; private final int applicationHeight = 800;
private Boolean press = false;
public PowerDownScreen(final RoboRallyWrapper roboRallyWrapper) { public PowerDownScreen(final RoboRallyWrapper roboRallyWrapper) {
camera = new OrthographicCamera(); camera = new OrthographicCamera();
viewport = new FitViewport(applicationWidth, applicationHeight, camera); viewport = new FitViewport(applicationWidth, applicationHeight, camera);
@ -35,7 +36,8 @@ public class PowerDownScreen implements Screen {
powerDownButton.addListener(new InputListener() { powerDownButton.addListener(new InputListener() {
@Override @Override
public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) { public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
return true; press = true;
return true;//her we do stuff
} }
}); });
} }
@ -63,6 +65,10 @@ public class PowerDownScreen implements Screen {
roboRallyWrapper.setScreen(roboRallyWrapper.screenManager.getMainMenuScreen(this.roboRallyWrapper)); roboRallyWrapper.setScreen(roboRallyWrapper.screenManager.getMainMenuScreen(this.roboRallyWrapper));
dispose(); dispose();
} }
else if (press){
roboRallyWrapper.setScreen(roboRallyWrapper.screenManager.getLoadingScreen(this.roboRallyWrapper));
dispose();
}
} }
@Override @Override