Can't set config.height and config.width in LibGDX

Viewed 52

I've recently started working on a Chess game in LibGDX. I can't figure how to set the desktop width and height.

Here is my Desktop Launcher code:

package com.mygdx.game;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
import com.mygdx.game.chess;

public class DesktopLauncher {
    public static void main (String[] arg) {
        Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
        config.setForegroundFPS(60);
        config.setTitle("Chess");
        config.height = 800;
        config.width = 800;
        new Lwjgl3Application(new chess(), config);
    }
}

I am also using a tutorial from 2020, perhaps the code is outdated, but I can't find any solution so far. Any help is appreciated.

1 Answers

Try this:

config.setWindowedMode(800, 800)

source code with the description is here

Related