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

Re: [pygame] the changes



> >  BREAK: Surface.blit takes a source rectangle ...
> 
> Why not have the blit function accept either format of args?
> It seems like it could be useful in some situations.

it would be easy to support both. i just couldn't think of
any these circumstances. :]   i'd be glad to see one though!

since the rectstyle supports all the popular data
types anyways, i kind of figure there's not much need.

#first we create the 'popular' data types
x, y = 10, 20
h, w = 100, 200
pos = x, y
size = h, w
r = new_rect(pos, size)

#now we blit away
dst.blit(src, (0, 0), (x, y, w, h))
dst.blit(src, (0, 0), (pos, size))
dst.blit(src, (0, 0), pos + size)
dst.blit(src, (0, 0), r)

supporting the original blit style lets us do case #2
without needing the parens. dst.blit(src, (0, 0), pos, size)
of course, it also keeps things from breaking the original
releases. but we're still early enough in the game that i'm
not to worried about that.

by then time 1.0 rolls around (near the end of the year)
the interface is gonna really lock down. it's gonna take
a team of wild horses and their well trained lawyers to
put up a good enough argument that makes breaking backwards
compatability seem like a good idea. at that point if i
wanted this type of change there would definitely be 
support for both styles.

but that's what this early release period is for, right ;]


when switching aliens.py and oldaliens.py over to the new
blit routines, using the rects made things a cleaner and 
even removed a line that was no longer needed :]

btw, i just scored 117 on aliens! BINGO!


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