Skip to content Skip to sidebar Skip to footer

Pygame Dual Monitors And Fullscreen

I am using pygame to program a simple behavioral test. I'm running it on my macbook pro and have almost all the functionality working. However, during testing I'll have a second, e

Solution 1:

Pygame doesn't support two displays in a single pygame process(yet). See the question here and developer answer immediately after, where he says

Once SDL 1.3 is finished then pygame will get support for using multiple windows in the same process.

So, your options are:

  1. Use multiple processes. Two pygame instances, each maximized on its own screen, communicating back and forth (you could use any of: the very cool python multiprocessing module, local TCP, pipes, writing/reading files, etc)
  2. Set the same resolution on both of your displays, and create a large (wide) window that spans them with your information on one half and the user display on the other. Then manually place the window so that the user side is on their screen and yours is on the laptop screen. It's hacky, but might a better use of your time than engineering a better solution ("If it's studpid and it works, it ain't stupid" ;).
  3. Use pyglet, which is similar to pygame and supports full screen windows: pyglet.window.Window(fullscreen=True, screens[1])

Good luck.

Solution 2:

I do not know if you can do this in OS X, but this is worth mentioning for the Windows users out there, if you just want to have your program to run full screen on the second screen and you are on windows, just set the other screen as the main one.

The setting can be found under Rearrange Your Displays in settings.

So far for me anything that I can run on my main display can run this way, no need to change your code.

Post a Comment for "Pygame Dual Monitors And Fullscreen"