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

Pygame_zero windows open in the middle of the screen #314

Open
bjazmoore opened this issue Apr 27, 2023 · 0 comments
Open

Pygame_zero windows open in the middle of the screen #314

bjazmoore opened this issue Apr 27, 2023 · 0 comments

Comments

@bjazmoore
Copy link

bjazmoore commented Apr 27, 2023

by changing the first few lines of runner.py these windows can be comfortably opened in the upper right corner of the user's screen:

import pygame
import os
pygame.mixer.pre_init(frequency=22050, size=-16, channels=2)
# Add code before pygame.init() to position window that will be opened.
# This will cause any windows created to be opened at 40, 40
x = 60
y = 80
os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (x,y)
pygame.init()

Note that 'import os' must be moved (shifted) up several lines in the code to make this work.

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