Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting screen size #65

Open
einarf opened this issue Sep 27, 2020 · 0 comments
Open

Getting screen size #65

einarf opened this issue Sep 27, 2020 · 0 comments

Comments

@einarf
Copy link

einarf commented Sep 27, 2020

There is already a cross platform soltution for getting screen resolution:

width, height = arcade.get_display_size()

It should replace this section:

self.screensize = 1920,1080
# Fullscreen information get based on OS
if platform.system() == 'Linux':
print("This game expects linux users to be using a 1080p, 16:9 monitor. Other aspect ratios or resolutions on linux may cause issues.")
"""
cmd = ['xrandr']
cmd2 = ['grep', '*']
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
p2 = subprocess.Popen(cmd2, stdin=p.stdout, stdout=subprocess.PIPE)
p.stdout.close()
resolution_string, junk = p2.communicate()
resolution = resolution_string.split()[0]
width, height = resolution.split('x')
self.screensize[0] = width
self.screensize[1] = height
"""
self.screensize = (1920, 1080)
elif platform.system() == 'Windows':
user32 = ctypes.windll.user32
self.screensize = user32.GetSystemMetrics(0), user32.GetSystemMetrics(1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant