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

Re: [pygame] Problem with get_rect()



From the same documentation at pygame.org:

get_rect
Surface.get_rect(**kwargs) -> rect

      Returns a new rectangle covering the entire surface. This
rectangle will always start at 0, 0 with a width. and height the same
size as the image.
       
      You can pass keyword argument values to this function. These
named values will be applied to the attributes of the Rect before it
is returned. An example would be 'mysurf.get_rect(center=(100,100))'
to create a rectangle for the Surface centered at a given position.

On 7/19/05, Marcus von Appen <mva@xxxxxxxxxxxx> wrote:
> On, Tue Jul 19, 2005, Sami Hangaslammi wrote:
> 
> > 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
> 
> The documentation does not seem to be out of sync, but instead Ari
> seemed to refer to something wrong. To citate from
> pygame.Surface.get_rect.__doc__ (from the currently 'official' stable
> 1.6 release) and the documentation at pygame.org:
> 
> """
> Surface.get_rect() -> rect
> get a rectangle covering the entire surface
> 
> Returns a new rectangle covering the entire surface.
> This rectangle will always start at 0, 0 with a width.
> and height the same size as the image.
> """
> 
> I wonder, where you both got your information from.
> 
> Regards
> Marcus
> 
> 
>