Link Search Menu Expand Document

如何下指令,執行 export

範例

前置作業

在匯出前,需要先下載安裝「Export templates」

下載連結,可以在「Godot Engine / Download / Linux」這個面,使用關鍵字「Export templates」查詢,

可以找到下面兩個連結

我是使用「gdscript」,所以選擇「Export templates (standard)」下載。

也可以到「GitHub / godotengine / godot / Releases / 3.4.2-stable」,找到相關的下載連結。

我是下載「GitHub」上的檔案,所以執行下面指令下載

wget -c 'https://github.com/godotengine/godot/releases/download/3.4.2-stable/Godot_v3.4.2-stable_export_templates.tpz'

安裝後的路徑, 舉例:我在Arch安裝後,路徑是在「~/.local/share/godot/templates/3.4.2.stable」。

匯出指令範例

執行下面指令匯出

godot --export 'Linux/X11' '/tmp/demo_game'

export_presets.cfg

若是專案沒有「export_presets.cfg」,則會顯示下面指令。

ERROR: This project doesn't have an `export_presets.cfg` file at its root.
Create an export preset from the "Project > Export" dialog and try again.
   at: _fs_changed (editor/editor_node.cpp:801)

匯出後續測試

執行下面指令

file /tmp/demo_game

顯示

/tmp/demo_game: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 5.9.0, stripped

執行下面指令

/tmp/demo_game

就會執行該遊戲。

執行下面指令,會顯示 help 資訊

/tmp/demo_game -h

執行下面指令,則會執行該遊戲,並且全螢幕顯示

/tmp/demo_game -f