[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] blit() problem



Geekius Maximus schrieb:
I'm having an issue with the pygame.display.blit() method. According to the documentation:

<B>Surface.blit(source, dest, area=None): return Rect

An optional area rectangle can be passed as well. This represents a smaller portion of the source Surface to draw.</b>

Whenever I try to blit a smaller part of any Surface using the third rect, nothing gets blitted at all. The exception is when I blit part of the background surface over something, which works fine. I'll have a small code example later. If anyone has any ideas, I'd appreciate it.

For God's glory,
Geekius

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Hi

esample:

ontoSurface.blit(sourceImage, destcoord, sourceRect): return rect


ontoSurface is the surface to blit on
sourceImage is the image that get blitet onto the ontoSurface
destcoord is something like (0,0) ( or a rect argument where r.topleft is used normaly the image rect e.g. sourceImage.get_rect() )
sourceRect is a rect in the sourceImage to get the pixels from ( make sure that sourceRect.topleft is in the dimensions of sourceImage)


Hope this clarifies things a bit more and helps you.

~DR0ID