How do I make a libGDX Desktop application resizable?(如何使 libGDX 桌面应用程序可调整大小?)
问题描述
libGDX 应用程序必须实现 .resize(int width, int height) 方法,所以我认为调整 libGDX 应用程序的大小并不是什么大问题,但我发现无法制作实际的应用程序 JFrame 或任何可拖动的东西使用 JFrame.setResizable(true).这对 libGDX 来说是不可能的吗?
libGDX Applications must implement the .resize(int width, int height) method, so I figured that resizing a libGDX app is not a big deal, but I found no way to make the actual application JFrame or whatever that is draggable as with JFrame.setResizable(true). Is that simply not possible with libGDX ?
推荐答案
如果你的桌面应用使用 gdx-backend-lwjgl,那么你可以使用:
If you use gdx-backend-lwjgl for you desktop app, then you can use:
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.resizable = true;
new LwjglApplication(new YourGame(), config);
使用来自 SVN 中继的最新源.
Use newest source from SVN trunk.
这篇关于如何使 libGDX 桌面应用程序可调整大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!