[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Possible default?



Magnus Lie Hetland wrote:
> Just a thought... Why not allow
>   foo.blit(bar)
> to mean
>   foo.blit(bar, bar.get_rect())

the second 'position' argument for blit can take any 2d coordinate. so 
you can just say.
    foo.blit(bar, (0, 0))

as you're doing above, you can also optionally just pass a Rect argument 
for the position. but the blit only uses the position of the topleft 
corner of the Rect, it doesn't do anything with the size.

i've occasionally had the thought to make that second argument optional, 
having it default to (0, 0), but i keep thinking that's just too lazy 
and have decided against it :]

the Surface.get_rect() just always returns a rectangle the size of the 
image at (0, 0). so there's no way to manipulate this for the blitting.





____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org