"ast" <nom...@invalid.com> wrote: >DISPLAYSURF = pygame.display.set_mode((400, 300)) >pygame.display.set_caption('Hello World!') > >The first line opens a 400x300 pygame window. >The second one writes "Hello World" on top of it. > >I am just wondering how function set_caption finds the windows >since the window's name DISPLAYSURF is not passed as >an argument
https://www.pygame.org/docs/ref/display.html As it says, there is only *one* display surface, and any non-displayed surface must be blitted (copied) onto the display surface for visibility. So all "pygame.display" methods refer to that one display surface. Non displayed surfaces, on the other hand, do need to be instantiated with "pygame.Surface" -- https://mail.python.org/mailman/listinfo/python-list