Skip to content

Getting screen size #65

Description

@einarf

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions