Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

Alterando o ícone do aplicativo para Windows

Por padrão, o ícone do projeto exportado será o ícone do Godot. Você provavelmente vai querer mudar isso para seu projeto. Existem dois tipos de ícones que podem ser alterados no Windows: o ícone do arquivo e o ícone da barra de tarefas.

Creating a custom ICO file

Nota

Since Godot 4.1, Godot can create an ICO file for you based on the icon file defined in the Windows export preset. This icon file can be in PNG, WebP or SVG format. If no icon is defined in the Windows export preset, the application/config/icon project setting is used automatically instead.

This means you no longer need to follow the steps in this section to manually create an ICO file, unless you wish to have control over the icon design depending on its displayed size. Note that even if Godot creates the ICO file for you, you still need to set up rcedit so that the file icon actually changes.

Windows does not use formats such as PNG or JPEG 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.

Este tutorial em vídeo explica como exportar um arquivo ICO com o GIMP.

Também é possível converter uma imagem PNG para um arquivo ICO amigável ao hiDPI usando este comando do ImageMagick:

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

Aviso

Para o arquivo ICO apropriadamente substituir o ícone Godot predefinido, ele deve conter todos os tamanhos inclusos no ícone Godot predefinido: 16x16, 32x32, 48x48, 64x64, 128x128, 256x256. Caso o arquivo ICO não contenha todos os tamanhos, o ícone Godot predefinido será mantido para os que não foram substituídos.

O comando de ImageMagick acima leva isso em consideração.

Mudando o ícone da barra de tarefas

O ícone da barra de tarefas é o ícone que aparece na barra de tarefas quando seu projeto está sendo executado.

../../_images/icon_taskbar_icon.png

To change the taskbar icon, go to Project > Project Settings > Application > Config, make sure Advanced Settings are enabled to see the setting, then go to Windows Native Icon. Click on the folder icon and select your ICO file.

../../_images/icon_project_settings.webp

Esta configuração só altera o ícone do jogo exportado no Windows. Para definir o ícone para macOS, use Macos Native Icon. E para qualquer outra plataforma, use a configuração Icon.

Mudando o ícone do arquivo

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.

O ícone do arquivo é o ícone do executável que você clica para iniciar o projeto.

../../_images/icon_file_icon.png

Antes de selecioná-lo nas opções de exportação, você precisará instalar uma ferramenta extra chamada rcedit. Você pode baixá-la aqui.

After downloading, you need to tell Godot the path to the rcedit executable on your computer. Go to Editor > Editor Settings > Export > Windows. Click on the folder icon for the rcedit entry. Navigate to and select the rcedit executable.

Nota

Os usuários de Linux e macOS também precisarão instalar o WINE para usar o rcedit.

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

../../_images/icon_rcedit.webp

You should now have everything in place to change the file icon. To do that, you will need to specify the icon when exporting. Go to Project > Export. Assuming you have already created a Windows Desktop preset, select your icon in ICO format in the Application > Icon field.

Aviso

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.webp

Nota

Se o rcedit falhar em alterar o ícone, você pode em vez disso compilar seus próprios modelos de exportação Windows com o ícone alterado. Para isso, substitua o platform/windows/godot.ico pelo seu próprio arquivo ICO antes de compilar os modelos de exportação.

Uma vez feito isso, você pode especificar seus modelos de exportação como modelos de exportação personalizados na predefinição de exportação do Windows do seu projeto.

Testando o resultado

Agora você pode exportar o projeto. Se funcionou corretamente, você deve ver isto:

../../_images/icon_result.png

Nota

Se seu ícone não estiver aparecendo corretamente, no Windows 10, tente limpar o cache de ícones. Para isso, abra a caixa de diálogo Executar e digite ie4uinit.exe -ClearIconCache ou ie4uinit.exe -show.