如何从我的 LIBGDX 游戏中制作可执行文件

时间:2023-03-01
本文介绍了如何从我的 LIBGDX 游戏中制作可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我以前从未将程序制作成可执行文件,而且我一直在研究如何做到这一点已经有一段时间了.当我尝试将其放入 jar 中时,一切正常,但是当我尝试运行它时,没有任何反应.

I've never made a program into an executable before, and I've been looking into how to do this for some time now. When I try to put it into a jar everything works fine but when I try to run it nothing happens.

如何将我的游戏制作成可执行文件以便它可以运行(在 Windows 上,而不是在 android 上)我觉得我没有将它链接到图书馆或其他东西......不确定.谢谢!

How do I make my game into an executable so it can be run (on windows, not android) I feel like I am not Linking it to the libraries or something... Not sure. Thanks!

我应该补充一下,我得到了错误

I should add I get the error

JAR export finished with warnings. See details for additional information. 
duplicate entry: com/badlogic/gdx/utils/arial-15.fnt 
duplicate entry: com/badlogic/gdx/utils/arial-15.fnt 
duplicate entry: com/badlogic/gdx/utils/arial-15.png 
duplicate entry: com/badlogic/gdx/utils/arial-15.png 
Jar export finished with problems. 
See details for additional information. 

推荐答案

您的问题是,当您使用 eclipse export as Executable jar 文件时,它不包含您在 gdx 中使用的资产(图形、声音...)项目.您可以手动执行的操作是将您的资产文件夹复制到生成的 jar 文件旁边,或者使用您最喜欢的 zip 管理工具将您的资产文件夹包含在您的 jar 文件中.

Your problem is that when you use eclipse export as Executable jar file it does not include the assets (graphical, sounds ...) that you used in your gdx project. What you can do manually is either copy your assets folder right next to the generated jar file or include your assets folder in your jar file with your favorite zip management tool.

另一种方法是使用相同的 eclipse 导出向导并选中另存为 ANT 脚本",然后编辑生成的 ant 文件以包含您的应用所需的所有文件和文件夹.

Another way would be to use this same eclipse export wizard and check "Save as ANT script" and then edit the generated ant file to include all the files and folders needed by your app.

希望对你有帮助

这篇关于如何从我的 LIBGDX 游戏中制作可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

上一篇:libGDX 项目无法加载库 liblwjgl.dylib 下一篇:将 Admob 添加到 Libgdx 游戏

相关文章