Created
September 9, 2019 15:48
-
-
Save markph0204/b0e38e261ec1bb6fc5f010216452a016 to your computer and use it in GitHub Desktop.
Pygame Fullscreen test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame | |
pygame.init() | |
pygame.display.set_mode((640, 480)) | |
modes = pygame.display.list_modes() | |
# pygame.display.set_mode(modes[0], pygame.FULLSCREEN) | |
FULLSCREEN = False | |
notdone = True | |
while notdone: | |
for event in pygame.event.get(): | |
if event.type == pygame.QUIT: | |
notdone = False | |
if event.type == pygame.KEYDOWN: | |
if event.key == pygame.K_ESCAPE: | |
notdone = False | |
elif event.key == pygame.K_f: | |
if not FULLSCREEN: | |
pygame.display.set_mode(modes[0], pygame.FULLSCREEN) | |
else: | |
pygame.display.set_mode((640, 480)) | |
FULLSCREEN = not FULLSCREEN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment