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

Re: [pygame] resizable



Pavel,

I would be interested to know how you do that. Perhaps you could show a snippet of
code.

One thing which doesn't answer your question but might still be helpful, is the method
for detecting the current display resolution. I spent more hours than you could
imagine trying to figure out how to do it (under Windows only):

List_Modes can give modes higher than the current resolution! If you try to change
display mode to a resolution which is too high for the display device, the user doesn't
get to see a lot! So it's much safer to detect the current display resolution and work
within that.

import win32api
SM_CXSCREEN = 0  # I didn't find any include file which defines these contstants
SM_CYSCREEN = 1


x = win32api.GetSystemMetrics(SM_CXSCREEN)
y = win32api.GetSystemMetrics(SM_CYSCREEN)

Incidentally, my father was called Pavel and he came from Kosice. I guess that's
somewhere near to you!

> I have tried to make my window resizable. It works just a half. I was even able to catch that event
> but no idea how to get a size of a new window, so I can resetÿ atributes of a window with
> pygame.display.set_mode(size).
>
> Thanks a lot
> Pavel
>
> --
> gen2n
> ICQ 176015287
>
>

--
Regards
Ben Friman
t 0870 041 0935
w www.learntotype.com