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

[pygame] today's little update



well i've been on the warpath of upgrades, and recently checked in
a nice set of routines into cvs.

first, i created a new pygame module named draw. currently the
draw module only has one function, line(). This is actually a
bit of code, but the line drawing is fairly well optimized and
it respects the surface clipping rectangle.


secondly, i've added some alpha routines into the surfarray
module. these new surfarray routines are currently untested,
but they are based on the other working functions, so i'm
guessing they'll work (heh, still a little early for them)
the new functions in surfarray are; pixels_array, array_alpha,
and array_colorkey. there's really no way to assign the alpha
values yet unless your surface is 32bits (you can then use the
pixels_array function). these functions should help you out if
you end up needing to write your own pixel-collision style routines
in python.

btw, i've been chatting about pixel level collision routines,
and the general consensus is they are just too slow. the best way
to go about this type of collision is to just use a smaller rectangle
to collide against, or breaking the sprite down into a few smaller
rectangles. (as was suggested earlier)

anyways, all the changes are in CVS now. i'll be testing the
surfarray alpha functions a bit later tonight, but the line
drawing is definitely tested and working well now.


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