[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Window positioning



Mark 'Kamikaze' Hughes wrote:
  From what I can tell, there's currently no portable way to set the
window position, but various platforms do have specific ways.  This is
very unpleasant for a game developer, and makes Pygame software look
strange to most users.

  I have no objection to setting the window size before Pygame.init(),
as long as I don't have to 'if os.name == ...' for each system.  Can
this be changed for the next version?
SDL uses a few exotic environment variables to help position the graphics window. sounds like you will be interested in SDL_VIDEO_CENTERED or SDL_VIDEO_WINDOW_POS

there are plenty of other environment variables you can use to control SDL (and thus, pygame). with python you can fairly easily set these up.

import os
os.environ["SDL_VIDEO_WINDOW_POS"] = "300,150"