Does anyone know how to set the canvas full screen in HTML5 LibGDX?
I only find width and height property in GwtApplicationConfiguration
.
I'm using a Stage so I had to use an InputMultiplexer to send input to both my Stage and the InputAdapter that handles fullscreen GWT requests.
InputAdapter webGlfullscreen = new InputAdapter() {
@Override
public boolean keyUp (int keycode) {
if (keycode == Keys.ENTER && Gdx.app.getType() == ApplicationType.WebGL) {
if (!Gdx.graphics.isFullscreen()) Gdx.graphics.setDisplayMode(Gdx.graphics.getDisplayModes()[0]);
}
return true;
}
};
Gdx.input.setInputProcessor(new InputMultiplexer(webGlfullscreen, stage));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With