[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Blit a surface with mask
On Fri, Jul 13, 2012 at 11:00 AM, Ricardo Franco <ricardo.krieg@xxxxxxxxx> wrote:
Hi, I have a surface where a play a movie:
background = "" 480))
video = pygame.movie.Movie('video.mpg')
And I have a black-white surface to use as mask:
mask = pygame.image.load('mask.png')
I want to 'crop' the video. Dont know if have to blit the video in the mask, or the reverse. Or to merge both into a new surface.
How do it?
The simplest possible way I can think of is to draw the video to an intermediary surface, then blit only a rectangle of that intermediary surface to your destination.