I am trying to change the name of a pygame window from "Pygame Window" to "test caption". I have tried:
pygame.display.set_caption('test caption')
But I don't think it is the right script.
First load the icon image as a surface, then use pygame. display. set_icon(surface) to change the icon. "A pygame Surface is used to represent any image.
Pygame only allows to create one single window. Different from other applications, those based on Pygame cannot have multiple windows. If for example dialog window is needed, it must be displayed within the main window.
Refer to http://www.pygame.org/docs/ref/display.html#pygame.display.set_caption:
set_caption(title, icontitle=None) -> None
If the display has a window title, this function will change the name on the window. Some systems support an alternate shorter title to be used for minimized displays.
Your usage was correct, so there must be another issue. Either your window is initialized incorrectly, or it isn't even initialized at all. Contributing your code would be helpful.
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