Example usage for com.badlogic.gdx ApplicationListener resize

List of usage examples for com.badlogic.gdx ApplicationListener resize

Introduction

In this page you can find the example usage for com.badlogic.gdx ApplicationListener resize.

Prototype

public void resize(int width, int height);

Source Link

Document

Called when the Application is resized.

Usage

From source file:es.eucm.ead.engine.EAdEngine.java

License:Open Source License

@Override
public void resize(int width, int height) {
    stage.setViewport(width, height, false);
    if (gameWidth > 0) {
        float scaleX = (float) width / gameWidth;
        float scaleY = (float) height / gameHeight;
        stage.getRoot().setScale(scaleX, scaleY);
    }//from ww w.  ja  va  2s. com
    for (ApplicationListener a : applicationListeners) {
        a.resize(width, height);
    }
}