Monday, April 28, 2025
HomeGame Developmentpython - Pygame show.Data() / fullscreen not working

python – Pygame show.Data() / fullscreen not working


I’m experiencing some points with pygame.show.Data() and the FULLSCREEN property on Linux. The sport is displaying at roughly 1.5 occasions the scale of the display screen. I noticed from different questions that there’s a identified workaround for Home windows, however nothing for Linux. I’m posting this query as a result of StackExchange will not permit me to touch upon the opposite chains till I’ve extra fame.

The opposite two questions:

https://stackoverflow.com/questions/27421391/pygame-display-info-giving-wrong-resolution-size

Pygame Fullsreen Show Concern

One of many proposed options for Home windows was to insert three traces of code:

ctypes.windll.user32.SetProcessDPIAware()
true_res = (windll.user32.GetSystemMetrics(0),windll.user32.GetSystemMetrics(1))
pygame.show.set_mode(true_res,pygame.Fullscreen)

The code above makes use of CTypes, which is why solely Home windows has an answer up to now. I respect any assist!

Under is the part of code in my venture giving me bother.


# Initialize pygame
pygame.init()

# Get display screen data for fullscreen
screen_info = pygame.show.Data()
WIDTH = screen_info.current_w
HEIGHT = screen_info.current_h

# Display screen setup - fullscreen mode
display screen = pygame.show.set_mode((WIDTH, HEIGHT), pygame.FULLSCREEN)

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments