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

RE: [pygame] Question about playing mpeg video



On Tue, 2005-10-18 at 09:04 -0500, Garry M. Gaber wrote:
> The code I have written so far looks like this:
> 
> self.bMovie = pygame.movie.Movie("./Art/test.mpeg")
> screen_size = (800, 600)
> screen = pygame.display.set_mode (screen_size)
> self.bMovie.set_display(screen)
> self.bMovie.play()
> while self.bMovie.get_busy():
>      time.sleep(0.1)
> 
> I am not sure how to add the code to make this blit to the offscreen
> surface...

self.bMovie = pygame.movie.Movie("./Art/test.mpeg")
screen_size = (800, 600)
screen = pygame.display.set_mode (screen_size)

offscreen = pygame.Surface(self.bMovie.get_size())
self.bMovie.set_display(offscreen)
center = offscreen.get_rect()
center.center = screen.get_rect().center

self.bMovie.play()
while self.bMovie.get_busy():
     screen.blit(offscreen, center)
     time.sleep(0.1)