我有一个Electron 游戏程序,我希望它是全屏使用
pygame.display.set_mode((width, height), pygame.FULLSCREEN)
.
我不知道计算机的宽度和高度(分辨率),所以我希望能够在MacOS和Windows上检索它,例如:
import platform
pf = platform.platform().lower()
if pf.startswith("windows"):
# code here
else:
# code here
我试过这个:
import pygame
pygame.init()
screen = pygame.display.set_mode((640, 480), pygame.FULLSCREEN)
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
pygame.quit()