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

Re: [pygame] Problem with get_rect()



On 7/19/05, Ari Cheslow <iamchillin@xxxxxxxxx> wrote:
> I've been working on a game of mine called Runtling and I've ran into
> a little problem with pygame.Surface.get_rect()  It says in the pygame
> documentation that get_rect takes keyword arguments.  However I've ran
> into error saying that it doesn't

Yep, seems like to documentation is out of sync with the 1.7 release.
Maybe the current CVS version has the keyword arguments? Anyway, you
only need two extra lines to do it without the keyword arguments, just
replace

return self.ani.image().get_rect(center=self.pos)

with

r = self.ani.image().get_rect()
r.center = self.pos
return r

-- 
Sami Hangaslammi