Re: [pygame] pygame ingration with wxpython

2008-04-12 Thread Ian Mallett
I've done: class SDLThread: def __init__(self,screen): self.m_bKeepGoing = self.m_bRunning = False self.screen = screen self.color = (255,0,0) self.rect = (10,10,100,100) def Start(self): self.m_bKeepGoing = self.m_bRunning = True thread.star

[pygame] BufferProxy (was Flood Filling Images)

2008-04-12 Thread Kevin
I was told about Surface.get_buffer() which returns a BufferProxy object, and after some poking around in help() and other documentation I'm still confused about how to actually use it. (I see the bufferproxy file is a .so file, so will I have to use some C fun to do anything more with it other tha

Re: [pygame] Center a display rect on screen

2008-04-12 Thread Mark Halegua
Thanks, that worked. TDH On Saturday 12 April 2008 22:20, Ian Mallett wrote: > To center the window do... > os.environ['SDL_VIDEO_CENTERED'] = '1' > ...before pygame.init() > > To center a rectangle inside the window, the top left is... > x = (ScreenWidth/2) - (RectWidth/2) > y = (ScreenHeight/2)

Re: [pygame] shadow demo

2008-04-12 Thread Ian Mallett
There really should be a way to increase the resolution with this algorithm... grrr. I

Re: [pygame] Center a display rect on screen

2008-04-12 Thread Noah Kantrowitz
Mark Halegua wrote: I want to center a rect on the screen. I know the formula for doing this based on the size of the rect and the screen resolution, but don't know how to specify where the rect starts on the screen. I've looked at the documentation, but don't see how to do this. this code

Re: [pygame] Center a display rect on screen

2008-04-12 Thread Ian Mallett
To center the window do... os.environ['SDL_VIDEO_CENTERED'] = '1' ...before pygame.init() To center a rectangle inside the window, the top left is... x = (ScreenWidth/2) - (RectWidth/2) y = (ScreenHeight/2) - (RectHeight/2) TopLeftOfRect = (x,y) HTH, Ian

[pygame] Center a display rect on screen

2008-04-12 Thread Mark Halegua
I want to center a rect on the screen. I know the formula for doing this based on the size of the rect and the screen resolution, but don't know how to specify where the rect starts on the screen. I've looked at the documentation, but don't see how to do this. this code is what I'm using to c

Re: [pygame] Exception in _numpysurfarray.py

2008-04-12 Thread Lorenz Quack
Marcus von Appen wrote: On, Sat Apr 12, 2008, Marcus von Appen wrote: [...] Here's a second version of the patch that should improve the pixels_alpha() method as well. It'd be great if you could give it a try, too. Regards Marcus I just realized that the pixels3d() isn't supposed to return

Re: [pygame] BUG: segfault when blitting surface to itself

2008-04-12 Thread claxo
On 11 Apr 2008 at 21:33, Marcus von Appen wrote: Is there some case where blitting a surface on itself might be desired or necessary? If not, I'll add a simple check that tests the passed surface on equality and let blit() throw an exception, if both are the same. Its also used by effects, as

Re: [pygame] Exception in _numpysurfarray.py

2008-04-12 Thread Marcus von Appen
On, Sat Apr 12, 2008, Marcus von Appen wrote: [...] Here's a second version of the patch that should improve the pixels_alpha() method as well. It'd be great if you could give it a try, too. Regards Marcus Index: lib/_numpysurfarray.py