lordmauve / lordmauve/pgzero

Pygame_zero windows open in the middle of the screen

Open
#314 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
611
Forks
211
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open runner.py and inspect the imports and initialization sequence before pygame.init(), then compare it with the example in the issue. Run a Pygame Zero program and verify that its window opens at the requested screen position.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop, game-dev
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.