Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

Windows用のアプリケーションアイコンの変更

デフォルトでは、エクスポートされたプロジェクトのアイコンはGodotアイコンになります。ほとんどの場合、プロジェクトに合わせてアイコンを変更する必要があります。 Windowsで変更できるアイコンには、ファイル・アイコンとタスクバー・アイコンの2種類があります。

Creating an ICO file

Windows does not use formats such as png or jpg for application icons. Instead, it uses a Windows-only format called ICO. You can create your application icon in any program but you will have to convert it to an ICO file using a program such as GIMP.

This video tutorial goes over how to export an ICO file with GIMP.

次の ImageMagick コマンドを使用して、PNG画像をhiDPI対応のICOァイルに変換することもできます。

magick convert icon.png -define icon:auto-resize=256,128,64,48,32,16 icon.ico

Depending on which version of ImageMagick you installed, you might need to leave out the magick and run this command instead:

convert icon.png -define icon:auto-resize=256,128,64,48,32,16 icon.ico

警告

For the ICO file to effectively replace the default Godot icon, it must contain all the sizes included in the default Godot icon: 16×16, 32×32, 48×48, 64×64, 128×128, 256×256. If the ICO file does not contain all the sizes, the default Godot icon will be kept for the sizes that weren't overridden.

The above ImageMagick command takes this into account.

タスクバー・アイコンの変更

タスクバー・アイコンは、プロジェクトの実行中にタスクバーに表示されるアイコンです。

../../_images/icon_taskbar_icon.png

To change the taskbar icon, go to Project → Project Settings → Application → Config → Windows Native Icon. Click on the folder icon and select your ICO file.

../../_images/icon_project_settings.png

This setting only changes the icon for your exported game on Windows. To set the icon for macOS, use Macos Native Icon. And for any other platform, use the Icon setting.

ファイル・アイコンの変更

In Godot 3.5 and later, you can change the file icon without external tools using godoticon. Changing the file icon this way should work for executables containing an embedded PCK.

警告

There are known issues when changing the application icon in executables that embed a PCK file. It's recommended to avoid using rcedit for now if you choose to enable the Embed Pck option for your Windows export preset in the Export dialog.

ファイル・アイコンは、プロジェクトを開始するためにクリックする実行可能ファイルのアイコンです。

../../_images/icon_file_icon.png

エクスポートオプションで選択する前に、rcedit という追加のツールをインストールする必要があります。こちら<https://github.com/electron/rcedit/releases> からダウンロードできます。

ダウンロード後、コンピューター上のrcedit実行可能ファイルへのパスをGodotに伝える必要があります。エディタ → エディタ設定 → Export → Windows に移動します。rcedit エントリのフォルダアイコンをクリックし、 rcedit実行可能ファイルまで移動して選択します。

注釈

rceditをLinuxおよびmacOSユーザーが使用するためには WINE <https://www.winehq.org/> をインストールする必要があります。

On macOS 10.15 (Catalina) or later, make sure to use a 64-bit version of both WINE and rcedit since 32-bit applications aren't supported anymore.

../../_images/icon_rcedit.png

これで、ファイル・アイコンを変更するためのすべてが準備できました。そのためには、エクスポート時にアイコンを指定する必要があります。プロジェクト → Export に移動します。既にWindowsデスクトッププリセットを作成している場合、Application → Icon フィールドでICO形式のアイコンを選択します。

警告

All the supplied metadata must be valid. Most importantly, the version identifiers must take the form major.minor.patch.revision where every component is required and is a positive integer. For instance, 1.2.0.0 is valid but 1.2.0 is not.

If you provide invalid metadata in the export preset, the application icon won't change as rcedit will fail to change the executable's metadata.

../../_images/icon_export_settings.png

注釈

If rcedit fails to change the icon, you can instead compile your own Windows export templates with the icon changed. To do so, replace platform/windows/godot.ico with your own ICO file before compiling export templates.

Once this is done, you can specify your export templates as custom export templates in your project's Windows export preset.

結果のテスト

これで、プロジェクトをエクスポートできます。正常に機能した場合、次のように表示されます。

../../_images/icon_result.png

注釈

If your icon isn't showing up properly, on Windows 10, try clearing the icon cache. To do so, open the Run dialog and enter ie4uinit.exe -ClearIconCache or ie4uinit.exe -show.