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

Re: [pygame] Surface.set_clip()



Jan Ekholm wrote:

> How should Surface.set_clip() work? I've been using it for ages to
> constrain some painting of hexes to a square area, and it has worked fine.
> Now I want to turn off clipping at some places. The solution I've been
> using so far has been to set the rect to the full size of the surface, but
> according to the docs:

 >

> So, how do I pass the "no rectangle"? Empty won't work, None won't work,
> () won't work either? Is there any performance penalty for having a clip
> setto the full surface vs. having no clip at all?


chackie, this one has got me. i just tried passing no arguments, and it 
'clears' the clipping rectangle just fine for me. this hasn't changed 
for a long time, so it should be working for you (i'd expect any pygame 
version above 1.0)

mysurface.set_clip()  #this should do it and work for you

in SDL, there is always a clipping rectangle. when it isn't set it's set 
to the full size of the surface. so no, there's no performance penalty 
for having it set to the full surface.

in cvs i just updated the function to also accept "None" to clear the 
clipping, but that's nothing you should need to get it working. i also 
fixed the docs :]



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