나는 파이 게임으로 작은 게임을 만들고 있습니다. 나는 게임의 창을 모니터 해상도의 크기로 만들고 싶다. 내 컴퓨터 화면의 해상도는 1920x1080이고 display.info는 창 크기도 1920x1080이라고 말합니다. 그러나 실행하면 화면 크기의 약 1.5 배 정도의 창을 만듭니다.파이 게임 display.info 잘못된 해상도 크기를 제공
import pygame, sys
def main():
#set up pygame, main clock
pygame.init()
clock = pygame.time.Clock()
#creates an object with the computers display information
#current_h, current_w gives the monitors height and width
displayInfo = pygame.display.Info()
#set up the window
windowWidth = displayInfo.current_w
windowHeight = displayInfo.current_h
window = pygame.display.set_mode ((windowWidth, windowHeight), 0, 32)
pygame.display.set_caption('game')
#gameLoop
while True:
window.fill((0,0,0))
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
#draw the window onto the screen
pygame.display.flip()
clock.tick(60)
main()
'pygame.display.set_mode ((windowWidth, windowHeight), pygame.FULLSCREEN, 32)' – martineau
나는 창 화면이 더 좋을 것입니다. 파이 게임이 왜 더 큰 화면을 제공하는지 이해하고 싶습니다. display.info가 현재 화면 해상도를 잡을 때. – Brian
문서는 "전달 된 인수는 표시 유형에 대한 요청이므로 실제 생성 된 표시는 시스템에서 지원하는 최상의 일치입니다"라고 말합니다. 요청하시는 1920x1080과 비교할 때 제공되는 것의 크기는 정확히 무엇입니까? 대형 화면 (디스플레이와 동일)은 전체 화면 모드를 사용하는 것이므로 다른 값을 선택하는 유일한 방법이라고 생각합니다. – martineau