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

Re: [pygame] problem - movie in pygame

The movie module was changed, and there is no loop argument currently. The docs were not update for this.

On Sat, Aug 8, 2009 at 9:41 AM, Wayne Dyck <wayne@xxxxxxxxxxxxxx> wrote:
A question that has me a little stumped. In a list e-mail from 2008,
bhaaluu submitted the following code to play simple movies with pygame,

I run a Debian GNU/Linux system, Python 2.4.4 and PyGame 1.7.

I use this script to play movies. Maybe you can modify it for your game?

"""Usage: python playMovie.py movie.mpg
  'q' = Quit
import pygame
from pygame.locals import *

def main(filepath):
 movie = pygame.movie.Movie(filepath)
 screen = pygame.display.set_mode(movie.get_size())

 pygame.event.set_allowed((QUIT, KEYDOWN))
 while movie.get_busy():
     evt = pygame.event.wait()
     if evt.type == QUIT:
     if evt.type == KEYDOWN and evt.unicode == u'q':
 if movie.get_busy():

if __name__ == '__main__':
 import sys

It works fine under Python 2.6 and pygame 1.8.1 and pygame 1.9.1,
however, if I change the "movie.play()" line to include an argument like
the docs say you should be able to, e.g. movie.play(1) I get the
following error message,

TypeError: play() takes no arguments (1 given)

My question is why?

Under pygame 1.7 this used to work. Has the underlying code changed and
the docs didn't keep up with it?

Thanks for any suggestions.


Visit my blog at http://oddco.ca/zeroth/zblog