コード例 #1
0
  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());
  }
コード例 #2
0
  @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);
  }
コード例 #3
0
 private void enableMouseWheel() {
   GameCameraState camera = Main.app.getStateManager().getState(GameCameraState.class);
   camera.setMouseWheelEnabled(true);
 }
コード例 #4
0
 public void dig() {
   GameCameraState Cam = Main.app.getStateManager().getState(GameCameraState.class);
   Cam.setMode(GameCameraState.CameraMode.SELECT_VOLUME);
 }