[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Fullscreen Display
On Tue, Dec 04, 2007 at 08:50:53PM +0000, Matt Smith wrote:
> Hi,
>
> 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
>
> I expected the set_mode method to treat the FULLSCREEN as an argument and
> not as a variable/ object. I can use the following line without a problem
> to initialise a windowed display for my program:
>
> screen = pygame.display.set_mode((xsize, ysize), 0, 32)
>
> Can anyone tell me where I'm going wrong?
>
> Thanks,
>
> Matt.
Sounds like you forgot:
from pygame.locals import *
Which is now the FULLSCREEN name gets into your program's namespace.
---
James Paige