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

RE: [pygame] Question about playing mpeg video



Hi Pete,

Thanks for the quick answers.

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...

Thanks,
Garry

-----Original Message-----
From: owner-pygame-users@xxxxxxxx [mailto:owner-pygame-users@xxxxxxxx] On
Behalf Of Peter Shinners
Sent: Tuesday, October 18, 2005 1:02 AM
To: pygame-users@xxxxxxxx
Subject: Re: [pygame] Question about playing mpeg video

On Mon, 2005-10-17 at 18:46 -0500, Garry M. Gaber wrote:
> How do I get video to play within the window of my application?

Create an offscreen surface the same size as the video. Then call
Movie.set_display() to your new surface. Now when you are drawing a
frame from your game, blit the offscreen surface to the display like any
other game object.