My current laptop has a 14 inch full HD screen that is 1920 pixels wide and 1080 pixels high. That's also the resolution pygame.display.Info().current_w, pygame.display.Info().current_h
returns. However, the physical size of every Pygame window (in centimeters) of the display seems to be the same as on my previous laptop which was 14 inches but not full HD, 1366 pixels wide and 768 pixels high.
The consequence of this is that if I do something like gamedisplay = pygame.display.set_mode((pygame.display.Info().current_w, pygame.display.Info().current_h), pygame.FULLSCREEN)
to get a full screen view on this laptop with a full HD screen, I can see only the center of the view (the view appears zoomed in, so to say), when on my previous laptop it worked fine.
How can I fix this? Is there a way to get the size of the screen in the non-HD way Pygame's most functions seem to measure it (which would be (1366, 768)
on my computer)?
By the way, on my specific computer, the problem can be solved with gamedisplay = pygame.display.set_mode((1366, 768), pygame.FULLSCREEN)
since I happen to know the size of an equivalent non-HD screen, but is there a way to do it in general, so that HD screen users wouldn't need to find out the resolution of an equally large non-HD screen to play Pygame fullscreen games?
Another silly finding: When I tried to solve this by myself, I noticed that pygame.display.Info().current_w
returns 1920
, but dir(pygame.display.Info())
returns an empty list, even though you'd expect the string 'current_w'
to be there...