【发布时间】:2017-08-01 20:49:57
【问题描述】:
我尝试让用户选择他想如何玩游戏。窗口和全屏模式没问题。我似乎没有开始工作的是无边框全屏/窗口全屏。 我在网上搜索,只找到一个对我有帮助的网站:
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);
}
一切都和以前一样,只是无边框的全屏有窗口工具栏(底部的东西)在它前面,就像在图片中一样。正常全屏工作正常。
【问题讨论】:
-
您是否要删除窗口应用程序的边框?如果是这样,那么您可能想尝试询问“如何从窗口应用程序中删除边框”。从现在开始,您的问题使很多人感到困惑。当您提出问题时,请具体说明,并将所有不相关的内容排除在外。
-
@MennoGouw 代码实际上已经删除了边框...