How to make full html5 screen in libgdx?

Does anyone know how to install a full canvas in HTML5 LibGDX?

I only find the width and height property in GwtApplicationConfiguration.

+4
source share
1 answer

I use Stage, so I had to use InputMultiplexer to send input to both my scene and InputAdapter, which handles full-screen 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));
+1
source

Source: https://habr.com/ru/post/1525912/


All Articles