Hi,
On Tue, Dec 04, 2007 at 08:50:53PM +0000, Matt Smith wrote:
> I have seen the following line used to initialise a full screen display in
> a number of books and tutorials:
>
> screen = pygame.display.set_mode((xsize, ysize), FULLSCREEN, 32)
>
> When I use it in my program then I get the following error:
>
> Traceback (most recent call last):
> File "bouncing_ball_OOP.py", line 63, in <module>
> screen = pygame.display.set_mode((xsize, ysize), FULLSCREEN, 32)
> NameError: name 'FULLSCREEN' is not defined
You need to import it, usually with
from pygame.locals import *
near the top of your program.
> I expected the set_mode method to treat the FULLSCREEN as an argument and
> not as a variable/ object.
That's not how Python works.
Cheers!
Marius Gedminas
--
If the code and the comments disagree, then both are probably wrong.
-- Norm Schryer
Attachment:
signature.asc
Description: Digital signature