{%hackmd HkOsb-H_D %} # Godot筆記 **目錄** [TOC] ## 建立專案 1.至官網下載godot引擎[下載連結](https://godotengine.org/download)。 2.執行 `Godot_***.exe` New Project  ## 使用VSCode調效 **版本注意** :::danger 已知 Godto_v4xx 版本無法使用下面範例 調適 VSCode。 ::: **VSCode下載插件** ``` godot-tools GDScript Formatter ``` 下載 python3 + pip terminal ``` pip install gdtoolkit ``` **Godot指引向VSCode** Editor / Editor Settings / Text Editor / External / ``` Use External Editor : On Exec Path : 指向使用者 VSCode.exe 絕對路徑 Exec Flags : {project} --goto {file}:{line}:{col} ``` **VSCode指向Godot** godot-tools / Extension Settings ``` Godot_tools: Editor_path : 指向使用者 Godot.exe 絕對路徑 ``` **VSCode調效設定** ``` 1.Run / Add Configuration => 產生 launch.json 2.鍵盤 F5 將會啟動調試專案。 ``` **不能啟動 檢查 Port 設定** ``` Godot Settings Debug Remote port => VSCode launch.json port Godot Settings Language Server Remote port => VSCode godot-tools Settings port ``` ---- ## Godot build HTML5 **Godto第一次 build HTML5,需要下載 HTML5 相關資源** [下載處](https://godotengine.org/download/windows), 選擇 **Export templates (standard)** `Project / Export / Add... / HTML5` **build HTML5** `Project / Export / Export Project` :::spoiler IIS 無法辨識 .PCK 檔案的問題 :::success 1. 開啟 IIS Manager 的 MIME Types 2. 新增副檔名 .pck 3. MIME type 輸入 ``` application/octet-stream ``` ::: ---- ## Skin 相關功能 ### 創建 skin :::success ### 創建 - skin.tscn UI  ### 創建對應Script - 在skin子節點上點選右鍵 `Attach Script` 將會創建Script。 - 腳本創建後,會標記在 Inspector 內。 - Script重新命名會影響skin索引。  ::: ### 引用其他Skin :::success ### skin引用 - skin.tscn UI  ### code引入 ```python= # A skin Script # 引入 export (PackedScene) var bSkinName var bSkin # 實例化 func _ready(): bSkin = bSkinName.instance() add_child(bSkin) # 註銷實例 func skinCancel(): remove_child(bSkin) ``` - Script export 後 skin 將會出現 對應的選項,需要將指定的 skin.tscn 拖曳進入 `empty`  ::: ## 電腦字體 - godot預設不會抓現有的電腦字體利用,需要import。 :::warning 設定方式 : 選擇相關物件 / Inspector / Theme Overrides / Fonts / New DynamicFont Font / Font Data / Load / import ::: --- ## 圖層 - godot 2D 顯示物件不具備圖層預設 (Scene/Local的上下關係也與圖層無關) - 需要在 Scene/Local 新增 CanvasLayer 並將需要分級的物件放置其內。 - 圖層上下等級調整 CanvasLayer / Layer --- ###### tags: `godot`
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.