public void onStartScreen() { System.out.println("GameScreen onStartScreen"); Game game = Main.app.getStateManager().getState(Game.class); game.setGameScreenController(this); timeLabel.setText(game.getTimeString()); GameCameraState Cam = Main.app.getStateManager().getState(GameCameraState.class); Cam.pointCameraAt(game.getMap().getMapCenter()); }
@NiftyEventSubscriber(id = "DepthSlider") public void depthSliderChanged(final String id, final ScrollbarChangedEvent event) { Scrollbar bar = event.getScrollbar(); Game game = Main.app.getStateManager().getState(Game.class); int High = 1 * BlockCoordinate.CHUNK_EDGE_SIZE; int Low = -1 * BlockCoordinate.CHUNK_EDGE_SIZE; High += BlockCoordinate.CHUNK_EDGE_SIZE; bar.setWorldMax(High - Low); GameCameraState camera = Main.app.getStateManager().getState(GameCameraState.class); int value = (int) event.getValue(); int slice = camera.getSliceTop() - camera.getSliceBottom(); camera.setSlice(High - value, High - value - slice); }
private void enableMouseWheel() { GameCameraState camera = Main.app.getStateManager().getState(GameCameraState.class); camera.setMouseWheelEnabled(true); }
public void dig() { GameCameraState Cam = Main.app.getStateManager().getState(GameCameraState.class); Cam.setMode(GameCameraState.CameraMode.SELECT_VOLUME); }