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

Re: [pygame] Problem with get_rect()



On 7/20/05, Marcus von Appen <mva@xxxxxxxxxxxx> wrote:
> 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.

http://www.pygame.org/docs/ref/Surface.html#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.

....

But it DOES actually work in pygame 1.7. I accidentally used the wrong
python interpreter when testing it a while ago. *dumb*

-- 
Sami Hangaslammi