[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] toggle_fullscreen



This is broken on some systems.  I think the docs
should state this more clearly.

A work around is to do close the display, and make a
new one.  ie. display.quit, display.init,
display.set_mode.

Have the fun!



 --- Ken Seehof <kseehof@neuralintegrator.com> wrote:
> 
> 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()
> 
> 

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org