[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[pygame] toggle_fullscreen
I can't seem to get pygame.display.toggle_fullscreen() to work.
I'm using Windows XP.
FullScreenMode = 0
import pygame, pygame.font
from pygame.locals import *
def main(client = None):
# Initialize pygame
pygame.init()
# Set the display mode
if FullScreenMode:
winstyle = FULLSCREEN
SCREENRECT = Rect(0, 0, 640, 480)
else:
winstyle = HWPALETTE
SCREENRECT = Rect(0, 0, 640, 480)
pygame.display.set_mode(SCREENRECT.size, winstyle, 16)
pygame.display.set_caption('toggle test')
# background and title
gsurface = pygame.display.get_surface()
while 1:
e = pygame.event.wait()
if e.type == KEYDOWN:
if e.key == K_ESCAPE:
break
if e.key == K_f:
print 'this should be toggling fullscreen right?'
pygame.display.toggle_fullscreen()
elif e.type == QUIT:
break
font = pygame.font.Font(None,30)
gsurface.blit(font.render('Press F to toggle Fullscreen mode', 1,
(100,0,200)), (160,220))
pygame.display.flip()
print 'pygame.quit...'
pygame.quit()
print 'pygame.quitted'
if __name__ == '__main__': main()
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org