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

Re: [pygame] blitting rects



> It's a shame that I can't use the rect object directly in the blit
> function call. I've been trying this:

it's a crying shame really. :[
the current arguments for the blit call are the result of a lot
of shuffling them around and testing for aesthetics. Right when
i did the 0.1 released i noticed how much more appropriate a
rectangle argument would be instead of position, size.
i decided to take a "wait and see" approach before making
any changes.

the blit should definitely be changed. i've already got a
few "breaking" changes ready to roll soon. best we get it
in now and do it all at once :[

the new blit syntax will be:
    Surface.blit(source, dstpos, [srcrect])



> But that doesn't work. Instead, I have to do this:
> 
> destsurface.blit(sourcesurface, source.rect[:2], source.rect[2:])
> Any thoughts? Am I missing something obvious?

heh, what about;
dst.blit(src, source.rect.topleft, source.reft.size)
not exactly what you're looking for, eh?

also, remember that the last two arguments for blit are
optional, if you leave them out you will simply blit the
entire source. but anytime you want to blit a sub-portion
of the source, yes, you'll need to use the two ugly arguments
for now.

i've waited... and now i see!


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