Find a package. Add it to your script. Build something of your own.
パッケージを見つけて、スクリプトへ。作りたいものに、まっすぐ進もう。
mkdir hello-app
cd hello-app
gd init
gd add @gd/helloThis records the package in gd.json and fetches it. You import it by its short name, hello.
gd.jsonに記録して取得します。スクリプトからは短い名前のhelloで読み込みます。
@import hello
func main():
print(hello.message("world"))
return 0Run gd main.gd to print hello, world. Your own files are imported the same way: @import "./settings".
gd main.gdでhello, worldを表示します。自分のファイルも@import "./settings"のように読み込めます。
Commit gd.json and gd.lock. Another machine restores the same versions with gd install --frozen. Remove a package with gd uninstall hello. Commands below starting with ext: add a native extension, which brings a compiled API.
gd.jsonとgd.lockをコミットします。別の環境ではgd install --frozenで同じ版を復元できます。外すときはgd uninstall helloです。下の一覧でext:から始まるコマンドは、コンパイル済みのAPIを足すネイティブ拡張です。