Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Change the Name of a Pygame window?

Tags:

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.

like image 360
R.T. Avatar asked Nov 12 '16 19:11

R.T.


People also ask

How do I change the pygame window icon?

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.

Can you have multiple windows in pygame?

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.


1 Answers

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.

like image 53
Douglas Avatar answered Oct 29 '22 15:10

Douglas