我试图让用户选择游戏的玩法方式。窗口模式和全屏模式都没有问题。但是我似乎无法让无边框全屏/窗口全屏正常运行。 我在网上搜索了很多,只找到一个帮助我的网站:
http://badlogicgames.com/forum/viewtopic.php?f=11&t=13863
我按照指示进行操作,我认为它有点有效,但我的问题是,Windows 10底部的工具栏总是在窗口前面。
这是它的外观图片:
颜色很糟糕,但只是为了测试目的。 代码如下:if (screenManager.FULLSCREEN) {
Gdx.graphics.setDisplayMode(Gdx.graphics.getDesktopDisplayMode().width, Gdx.graphics.getDesktopDisplayMode().height, true);
} else if (screenManager.WINDOWEDFULLSCREEN) {
System.setProperty("org.lwjgl.opengl.Window.undecorated", "true");
Gdx.graphics.setDisplayMode(Gdx.graphics.getDesktopDisplayMode().width,
Gdx.graphics.getDesktopDisplayMode().height, false);
} else {
Gdx.graphics.setDisplayMode(screenManager.WIDTH, screenManager.HEIGTH, false);
}
我该如何解决这个问题?
编辑: 我已经更新到1.9.2版本,该版本不再有setDisplayMode方法。 现在的代码看起来是这样的:
DisplayMode mode = Gdx.graphics.getDisplayMode();
if (screenManager.FULLSCREEN) {
Gdx.graphics.setWindowedMode(Gdx.graphics.getDisplayMode().width, Gdx.graphics.getDisplayMode().height);
Gdx.graphics.setFullscreenMode(mode);
} else if (screenManager.WINDOWEDFULLSCREEN) {
System.setProperty("org.lwjgl.opengl.Window.undecorated", "true");
Gdx.graphics.setWindowedMode(Gdx.graphics.getDisplayMode().width, Gdx.graphics.getDisplayMode().height);
//Gdx.graphics.setFullscreenMode(mode);
} else {
Gdx.graphics.setWindowedMode(screenManager.WIDTH, screenManager.HEIGTH);
}
一切都像以前一样,只是无边框全屏模式下,Windows工具栏(底部的那个东西)会在其前面显示,就像图片中一样。正常的全屏模式没有问题。