changing_application_icon_for_windows.rst 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. .. _doc_changing_application_icon_for_windows:
  2. Manually changing application icon for Windows
  3. ==============================================
  4. Windows applications use a Windows only format called ICO for their file icon and
  5. taskbar icon. Since Godot 4.1, Godot can create an ICO file for you based on the
  6. icon file defined in the Windows export preset. Supported formats are PNG, WebP,
  7. and SVG. If no icon is defined in the Windows export preset, the
  8. :ref:`application/config/icon <class_ProjectSettings_property_application/config/icon>`
  9. project setting is used automatically instead.
  10. This means you no longer need to follow the steps in this section to
  11. manually create an ICO file, unless you wish to have control over the icon
  12. design depending on its displayed size.
  13. Creating a custom ICO file
  14. --------------------------
  15. You can create your application icon in any program but you will have to convert it
  16. to an ICO file using a program such as GIMP.
  17. `This video tutorial <https://www.youtube.com/watch?v=uqV3UfM-n5Y>`_ goes over how to
  18. export an ICO file with GIMP.
  19. It is also possible to convert a PNG image to an hiDPI-friendly ICO file
  20. using this `ImageMagick <https://www.imagemagick.org/>`_ command:
  21. .. code-block:: none
  22. magick convert icon.png -define icon:auto-resize=256,128,64,48,32,16 icon.ico
  23. Depending on which version of ImageMagick you installed, you might need to leave out the ``magick`` and run this command instead:
  24. .. code-block:: none
  25. convert icon.png -define icon:auto-resize=256,128,64,48,32,16 icon.ico
  26. .. warning::
  27. For the ICO file to effectively replace the default Godot icon, it must
  28. contain *all* the sizes included in the default Godot icon: 16×16, 32×32,
  29. 48×48, 64×64, 128×128, 256×256. If the ICO file does not contain all the sizes,
  30. the default Godot icon will be kept for the sizes that weren't overridden.
  31. The above ImageMagick command takes this into account.
  32. Changing the taskbar icon
  33. -------------------------
  34. The taskbar icon is the icon that shows up on the taskbar when your project
  35. is running.
  36. .. image:: img/icon_taskbar_icon.png
  37. To change the taskbar icon, go to
  38. **Project > Project Settings > Application > Config**, make sure
  39. **Advanced Settings** are enabled to see the setting, then go to
  40. ``Windows Native Icon``. Click on the folder icon and select your ICO file.
  41. .. image:: img/icon_project_settings.webp
  42. This setting only changes the icon for your exported game on Windows.
  43. To set the icon for macOS, use ``Macos Native Icon``. And for any other platform,
  44. use the ``Icon`` setting.
  45. .. _doc_changing_application_icon_for_windows_changing_the_file_icon:
  46. Changing the file icon
  47. ----------------------
  48. The file icon is the icon of the executable that you click on to start
  49. the project.
  50. .. image:: img/icon_file_icon.png
  51. To do that, you will need to specify the icon when exporting.
  52. Go to **Project > Export**. Assuming you have already created
  53. a Windows Desktop preset, select your icon in ICO format in
  54. the **Application > Icon** field.
  55. .. image:: img/icon_export_settings.webp
  56. Testing the result
  57. ------------------
  58. You can now export the project. If it worked correctly, you should see this:
  59. .. image:: img/icon_result.png
  60. .. note::
  61. If your icon isn't showing up properly try clearing the icon
  62. cache. To do so, open the **Run** dialog and enter ``ie4uinit.exe
  63. -ClearIconCache`` or ``ie4uinit.exe -show``.