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

Re: [pygame] set_clip



> I could probably pass in the size of the entire surface, but that's not
> how it was supposed to work?

the last argument is optional. it is only needed if not blitting
the entire source image. it seems about 90% of the time people just
want to blit the full image, so it makes a lot of sense to support
that case.


<<meanwhile.. on another thread>>
> I must disagree, makes it look a lot like C, where you don't have
> constructors, but must use create_foo() or new_bar(). I'd put constructors
> capitalized, but leave all methods and functions lowercase as they are.

this was my first impression also. and i had it emplemented for
awhile. i had switched all my code to use it this way, but it never
really sat well. (as reasons mentioned in my previous longer post)

it just felt broken to have the following types of code

myevent   = pygame.event.Event()
mysurface = pygame.Surface(...)
mysoundfx = pygame.mixer.load(...)
mychannel = pygame.mixer.get_channel()
myvidinfo = pygame.display.get_info()
myarea    = pygame.Rect()
mycdrom   = pygame.cdrom.open(...)

there's just too many functions doing nearly the same thing, but
with two different styles. it feels a lot better for all these functions
to use this style.

since classes and types are pretty much the same thing, each one just
created in a different language. :P (this is definitely a python wart!)
but notice the python functions to create types are not capitalized
int(), float(), str(). this makes me a lot more comfortable with noncaps.

at this point i've got the "new_" style functions in cvs. of all the
methods, this one feels the most comfortable to me. it gets a lot of
things right, and leaves little room for confusion. on the other hand
i'm not 100% pleased with this setup. this just falls into one of those
tough categories where there's got to be a compromise.

the case isn't totally closed on this on this issue, but i think the
cement is drying.




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