I have two monitors with the same resolution plugged into my raspberry pi, with the primary display on the top and the secondary display on the bottom. I have pygame code to set a display screen, and I want the screen to show up on the second display only.
The code below worked for pygame 1.9.6 with python 3.7 running Debian bullseye, but no longer works on pygame 2.6.0 with python 3.11 running Debian bookworm. The pygame window just shows up on the primary display. What can I change to make it work for the new version of pygame?
I've tried to run pygame.display.get_num_displays() and it returns 2, so I tried this below and it still only showed on the first display:Both screens have resolution 1024*600, i just want the pygame to pop up on the second screen. Anyone can give me some tips on how what I'm doing wrong?
The code below worked for pygame 1.9.6 with python 3.7 running Debian bullseye, but no longer works on pygame 2.6.0 with python 3.11 running Debian bookworm. The pygame window just shows up on the primary display. What can I change to make it work for the new version of pygame?
Code:
pygame.init()self.screen = pygame.display.set_mode((1024, 600))os.environ['SDL_VIDEO_WINDOW_POS'] = '0,600’self.screen.fill((0, 0, 255))pygame.display.update()
Code:
screen = pygame.display.set_mode((0, 0), display=1)
Statistics: Posted by tkbeki — Wed Sep 04, 2024 9:31 pm — Replies 0 — Views 23