current_h, current_w: Height and width of the current video mode, or of the
desktop mode if called before the display.set_mode is called.
(current_h, current_w are available since SDL 1.2.10, and pygame
1.8.0) They are -1 on error, or if an old SDL is being used.1.8.0)
您可以使用
pygame.display.Info()
:docs说:
pygame.display.Info()
创建具有属性current_h
和current_w
的Info对象。 在调用display.set_mode
之前创建Info对象,然后使用对象中的current_h
和current_w
调用display.set_mode
。示例:
我对pygame了解不多,但这里有一种使用模块
win32api
的方法:更新:在浏览了docs之后,您似乎可以从
pygame.display.Info
获得它,如下所示:希望这有帮助!
我不知道这是否可行,但如果您只想使用全屏窗口,请使用以下选项:
(当然你还得
import pygame
)。相关问题 更多 >
编程相关推荐