帮助,我尝试在PC上进行像Terraria一样的分辨率,当它是全屏但仍然是窗口时。为什么这段代码不起作用?
package com.imaginegames.mmgame.desktop;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import com.imaginegames.mmgame.GameMain;
public class DesktopLauncher {
public static void main (String[] arg) {
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.foregroundFPS = 60;
config.title = "Millitary Madness";
config.width = Gdx.graphics.getWidth();
config.height = Gdx.graphics.getHeight();
new LwjglApplication(new GameMain(), config);
}
}
它说:
线程中的异常" main"显示java.lang.NullPointerException 在com.imaginegames.mmgame.desktop.DesktopLauncher.main(DesktopLauncher.java:13)