layout: manual language: zh github: title: Defold 开发 Linux 游戏 brief: 本教程介绍了如何在 Linux 上编译运行 Defold 游戏 —

Linux 开发

在 Linux 上编译运行 Defold 游戏十分简单.


Linux 相关设置位于 game.project 文件的 Linux 部分.


Q: Why is the Defold editor super small when run on a 4k or HiDPI monitor when using GNOME?

A: Change the scaling factor before running Defold. source

$ gsettings set org.gnome.desktop.interface scaling-factor 2

Q: Why does mouse clicks on Elementary OS go through the editor onto whatever is below?

A: Start the editor like this:

$ GTK_CSD=0 ./Defold

Q: Why does the Defold editor crash when I try to create a new project, or open an existing one?

A: On certain distributions (like Ubuntu 18) there is an issue with the version of jogamp/jogl Defold uses vs. the version of Mesa on the system.

See the following reports for more information:

If this is your problem try the following workaround:

$ ./Defold

And if that doesn’t work then try (or some other version number matching your driver and larger than or equal to 2.1):

$ ./Defold

You may also need to specifically load libffi version 6 before starting Defold:

$ export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/

Q: Why am I getting “com.jogamp.opengl.GLException: Graphics configuration failed” when launching Defold on Ubuntu 20.04?

A: On certain distributions there is an issue with the new Mesa drivers (Iris) when running Defold. You can try using an older version when running Defold:

$ ./Defold

Q: Why doesn’t my Defold game start when I try to run it on Linux?

A: Check the console output in the editor. If you get the following message:

dmengine: error while loading shared libraries: cannot open shared object file: No such file or directory

Then you need to install libopenal1. The package name varies between distributions, and in some cases you might have to install the openal and openal-dev or openal-devel packages.

$ apt-get install libopenal-dev