"It may be a silly question, but It's a silly problem that I can't find a doc for it." -> "这可能是个愚蠢的问题,但我找不到相关文档。"
"Pygame gives me these flags for display.set.mode():" -> "Pygame为display.set.mode()提供了以下标志:"
没有办法“切换回”全屏模式,因为没有像SDL中的“WINDOWED”标志。
"pygame.display.toggle_fullscreen()"也不起作用。(至少我没能让它起作用)。
我已经尝试过“-1”或“0”或“not FULLSCREEN”,但都不起作用(使用“0”作为标志,屏幕变得“奇怪”...我不知道发生了什么哈哈,但它不是WINDOWED)。
"Pygame gives me these flags for display.set.mode():" -> "Pygame为display.set.mode()提供了以下标志:"
pygame.FULLSCREEN create a fullscreen display
pygame.DOUBLEBUF recommended for HWSURFACE or OPENGL
pygame.HWSURFACE hardware accelerated, only in FULLSCREEN
pygame.OPENGL create an OpenGL renderable display
pygame.RESIZABLE display window should be sizeable
pygame.NOFRAME display window will have no border or controls
好的,我可以进入全屏模式..现在这是我的代码:
__author__ = 'EricsonWillians'
from pygame import *
import ctypes
init()
user32 = ctypes.windll.user32
screenSize = user32.GetSystemMetrics(0)/2, user32.GetSystemMetrics(1)/2
size = (screenSize)
screen = display.set_mode(size)
display.set_caption("Game")
done = False
clock = time.Clock()
def keyPressed(inputKey):
keysPressed = key.get_pressed()
if keysPressed[inputKey]:
return True
else:
return False
while not done:
for e in event.get():
if e.type == QUIT:
done = True
if keyPressed(K_F10):
if screen == display.set_mode(size):
screen = display.set_mode(size, FULLSCREEN)
else:
screen = display.set_mode(size, "What flag should I put here for 'windowed'?")
screen.fill((0,0,0))
display.flip()
clock.tick(60)
quit()
没有办法“切换回”全屏模式,因为没有像SDL中的“WINDOWED”标志。
"pygame.display.toggle_fullscreen()"也不起作用。(至少我没能让它起作用)。
我已经尝试过“-1”或“0”或“not FULLSCREEN”,但都不起作用(使用“0”作为标志,屏幕变得“奇怪”...我不知道发生了什么哈哈,但它不是WINDOWED)。