changing_application_icon_for_windows.rst 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. .. _doc_changing_application_icon_for_windows:
  2. Changing application icon for Windows
  3. =====================================
  4. By default, the exported project's icon will be the Godot icon.
  5. You will most likely want to change that for your project. There are two types
  6. of icons that can be changed on Windows: the file icon and the taskbar icon.
  7. Creating an ICO file
  8. --------------------
  9. Windows does not use formats such as png or jpg for application icons. Instead,
  10. it uses a Windows-only format called ICO. You can create your application icon
  11. in any program but you will have to convert it to an ICO file using a program such
  12. as GIMP.
  13. `This video tutorial <https://www.youtube.com/watch?v=uqV3UfM-n5Y>`_ goes over how to
  14. export an ICO file with GIMP.
  15. It is also possible to convert a PNG image to an hiDPI-friendly ICO file
  16. using this `ImageMagick <https://www.imagemagick.org/>`_ command:
  17. .. code-block:: none
  18. magick convert icon.png -define icon:auto-resize=256,128,64,48,32,16 icon.ico
  19. Depending on which version of ImageMagick you installed, you might need to leave out the ``magick`` and run this command instead:
  20. .. code-block:: none
  21. convert icon.png -define icon:auto-resize=256,128,64,48,32,16 icon.ico
  22. .. warning::
  23. For the ICO file to effectively replace the default Godot icon, it must
  24. contain *all* the sizes included in the default Godot icon: 16×16, 32×32,
  25. 48×48, 64×64, 128×128, 256×256. If the ICO file does not contain all the sizes,
  26. the default Godot icon will be kept for the sizes that weren't overridden.
  27. The above ImageMagick command takes this into account.
  28. Changing the taskbar icon
  29. -------------------------
  30. The taskbar icon is the icon that shows up on the taskbar when your project
  31. is running.
  32. .. image:: img/icon_taskbar_icon.png
  33. To change the taskbar icon, go to
  34. **Project → Project Settings → Application → Config → Windows Native Icon**.
  35. Click on the folder icon and select your ICO file.
  36. .. image:: img/icon_project_settings.png
  37. This setting only changes the icon for your exported game on Windows.
  38. To set the icon for macOS, use ``Macos Native Icon``. And for any other platform,
  39. use the ``Icon`` setting.
  40. Changing the file icon
  41. ----------------------
  42. .. warning::
  43. There are `known issues <https://github.com/godotengine/godot/issues/33466>`__
  44. when changing the application icon in executables that embed a PCK file.
  45. It's recommended to avoid using rcedit for now if you choose to enable the
  46. **Embed Pck** option for your Windows export preset in the Export dialog.
  47. The file icon is the icon of the executable that you click on to start
  48. the project.
  49. .. image:: img/icon_file_icon.png
  50. Before selecting it in the export options, you will need to install
  51. an extra tool called **rcedit**.
  52. You can download it `here <https://github.com/electron/rcedit/releases>`_.
  53. After downloading, you need to tell Godot the path to the rcedit executable
  54. on your computer.
  55. Go to **Editor → Editor Settings → Export → Windows**.
  56. Click on the folder icon for the **rcedit** entry.
  57. Navigate to and select the rcedit executable.
  58. .. note::
  59. Linux and macOS users will also need to install
  60. `WINE <https://www.winehq.org/>`_ to use rcedit.
  61. .. image:: img/icon_rcedit.png
  62. You should now have everything in place to change the file icon.
  63. To do that, you will need to specify the icon when exporting.
  64. Go to **Project → Export**. Assuming you have already created
  65. a Windows Desktop preset, select your icon in ICO format in
  66. the **Application → Icon** field.
  67. .. image:: img/icon_export_settings.png
  68. .. note::
  69. If rcedit fails to change the icon, you can instead
  70. :ref:`compile your own Windows export templates <doc_compiling_for_windows>`
  71. with the icon changed. To do so, replace
  72. `platform/windows/godot.ico <https://github.com/godotengine/godot/blob/master/platform/windows/godot.ico>`__
  73. with your own ICO file *before* compiling export templates.
  74. Once this is done, you can specify your export templates as custom export
  75. templates in your project's Windows export preset.
  76. Testing the result
  77. ------------------
  78. You can now export the project. If it worked correctly, you should see this:
  79. .. image:: img/icon_result.png
  80. .. note::
  81. If your icon isn't showing up properly, on Windows 10, try clearing the icon
  82. cache. To do so, open the **Run** dialog and enter ``ie4uinit.exe
  83. -ClearIconCache`` or ``ie4uinit.exe -show``.