First, I load my icon image:
icon = pygame.image.load ('apple2.png')
Then I set the icon by using set_icon method:
pygame.display.set_icon (icon)
I run the script, and my icon is not visible.
It shows this instead:

This may be because on some operating systems you must set the icon before defining your display. If you set it after defining your display, you may end up with what you have.
"Some systems do not allow the window icon to change after it has been shown." -Pygame Docs (http://pygame.org/docs/ref/display.html#pygame.display.set_icon)
If it starts to work but your icon doesn't look the way you expect it, try making your icon 16x16 or 8x8 and resizing it to 256x256(this may only apply to Windows).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With