根据 LibGDX 网页:
Android applications can have multiple activities. Libgdx games should usually only consist of a single activity. Different screens of the game are implemented within libgdx, not as separate activities. The reason for this is that creating a new Activity also implies creating a new OpenGL context, which is time consuming and also means that all graphical resources have to be reloaded.
但是,这并非不可能 - 只是不受欢迎。
我正在构建一个应用程序,旨在容纳一些在 LibGDX 中构建的游戏,以及一些信息 - 视频/音频、带插图的文本等,描述游戏的开发。
将其构建为本地 android 应用程序是否更好,只要用户想玩游戏,它就会启动和拆除 LibGDX?或者我应该通过 LibGDX 编写整个应用程序并尝试使用 UI 库等来做非游戏的东西吗?
抱歉,我无法将其确定为更具体的问题。在走上错误的道路之前,我真的很想知道。
最佳答案
链接的 Reddit 线程中的共识 here是设置和拆除 LibGDX Activity 并不是一个巨大的开销,特别是如果游戏很小(在我的例子中就是这样)。
我将选择此解决方案,并在用户停止玩游戏时简单地关闭 Activity。
关于java - 将多媒体与 LibGDX 集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11712866/