@Override
  public void resize(int width, int height) {
    super.resize(width, height);

    // message box won't respond to clicks on the far right if the stage hasn't been updated with a
    // larger size
    currentZoomX = width * 1f / (this.width * 2);
    // total new screen height in pixels divided by total number of rows on the screen
    currentZoomY = height * 1f / (this.height + messages.getGridHeight());
    // message box should be given updated bounds since I don't think it will do this automatically
    messages.setBounds(0, 0, width, currentZoomY * messages.getGridHeight());
    // SquidMouse turns screen positions to cell positions, and needs to be told that cell sizes
    // have changed
    input.reinitialize(
        currentZoomX, currentZoomY, (this.width * 2), this.height, 0, 0, width, height);
    currentZoomX = cellWidth / currentZoomX;
    currentZoomY = cellHeight / currentZoomY;
    input.update(width, height, true);
    stage.getViewport().update(width, height, true);
  }
예제 #2
0
 @Override
 public void resize(int width, int height) {
   super.resize(width, height);
 }