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

Re: [pygame] Centering a new window



Kristofer Wouk wrote:
I was just wondering if there's any way in pygame/SDL to center a window when it is created.
So far I haven't found anything.
i believe there's an SDL environment variable that should let you do it. try this.

import os
os.environ['SDL_VIDEO_WINDOW_POS'] = 'center'

before calling any of the pygame init functions. that or something like it may do it for you, there's a page in the sdl documentation about more of these env vars. http://sdldoc.csn.ul.ie/sdlenvvars.php


--
"Neither will I tell you by what authority I do these things"
pete*shinners.org