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

Re: [pygame]

black wrote:

> thanx Pete and what about the next step ? after setting that variable there is still no way for me to modify the position of my pygame window, should I consult somewhat method inside os module ?

well, it's my first post here...

I'm not an expert, but
according to this thread
it looks like SDL developers find it boo-boo to modify the
position of window *after* creating it, beacuse it is not portable.

Setting an environment variable "SDL_VIDEO_WINDOW_POS" via os.environ()
call lets you decide where new windows will be placed, but after
it's created - it's gone.

Please note that this thread is dated October 2001, maybe something
changed already? I'm also interested in this topic - Pete, will you
give us other clue how to solve it?


>>black wrote:
>>>I load and display an image and found it laid at center of the screen,
>>>here I want some method like set_xPos and set_yPos to set its location
>>>when it disappears, how can we achieve that plz ?
>>SDL has no built-in way to control the position of the window it creates. 
>>but there are some sneaky ways to control it with environment variables. 
>>before you create the window with pygame.display.set_mode() try some code 
>>like this.
>>import os
>>os.environ["SDL_VIDEO_WINDOW_POS"] = "10,10"