Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to avoid scaling Pygame window when "make UI larger" is used in Windows?

Tags:

python

pygame

I'm using Windows 10 option that makes user interface items slightly larger as usual (125%).

It looks like applications can decide whether to use this scaling or not.

My Pygame program seems to take this scaling into account. How can I make it ignore this so that a 100x100 Pygame screen is really 100x100 pixels on my display (not 125x125)?

like image 760
Aivar Avatar asked Mar 09 '23 22:03

Aivar


1 Answers

Found an answer from https://gamedev.stackexchange.com/questions/105750/pygame-fullsreen-display-issue:

import ctypes
ctypes.windll.user32.SetProcessDPIAware()
like image 131
Aivar Avatar answered Apr 16 '23 21:04

Aivar