Is there any way to hide the screen of 'pygame.display' and to make it visible afterwards without calling 'pygame.display.quit()'?
All you can do is minimize the window using pygame. display. iconify() .
Setting the display mode is handled with the function pygame. display. set_mode((width, height), flags, depth) Initialize a window or screen for display. The only required argument in this function is a sequence containing the width and height of the new display mode.
display. flip() for software displays. It allows only a portion of the screen to updated, instead of the entire area. If no argument is passed it updates the entire Surface area like pygame.
import os
os.environ["SDL_VIDEODRIVER"] = "dummy"
would be enough. See:
http://www.pygame.org/wiki/HeadlessNoWindowsNeeded
https://github.com/ntasfi/PyGame-Learning-Environment/issues/26#issuecomment-330440199
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