Home > other >  Question: pygame full screen function
Question: pygame full screen function

Time:09-20

Novice self-study, laughed

Problem description: pygame increases full screen, full screen and exit repeatedly, lead to the background image is more and more fuzzy
Speculation is magnified background after the size continue to enlarge? Convenient bosses, please advice a ha

The code is as follows:
If the event type==KEYDOWN:
If the event. The key==K_F11:
Fullscreen=not fullscreen
If fullscreen:
Size=pygame. Display. List_modes () [0]
Screen=pygame. Display. Set_mode (size, FULLSCREEN | HWSURFACE)
The else:
Size=(screen_settings screen_width, screen_settings screen_height)
Screen=pygame. Display. Set_mode (size)
Background=pygame. Transform. Smoothscale (background, size)
  • Related