Changeset 85:c56eeaabd850


Ignore:
Timestamp:
Sep 1, 2013, 8:57:03 PM (7 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
rebase_source:
7284486af5c464696f09294caf780b2980063323
Message:

Make the window resizable

Location:
nagslang
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nagslang/__main__.py

    r15 r85  
    1414    pygame.display.init()
    1515    pygame.font.init()
    16     pygame.display.set_mode(SCREEN, pgl.SWSURFACE)
     16    pygame.display.set_mode(SCREEN, pgl.SWSURFACE | pgl.RESIZABLE)
    1717    #pygame.display.set_icon(load_image(...))
    1818    pygame.display.set_caption('Nagslang')
  • nagslang/engine.py

    r41 r85  
    22
    33import pygame
     4import pygame.locals as pgl
    45
    56from nagslang import constants
     
    3435        while running:
    3536            for ev in pygame.event.get():
    36                 if ev.type == pygame.locals.QUIT:
     37                if ev.type == pgl.QUIT:
    3738                    running = False
     39                elif ev.type == pgl.VIDEORESIZE:
     40                    pygame.display.set_mode(ev.size,
     41                            pgl.SWSURFACE | pgl.RESIZABLE)
     42                    self._surface = pygame.display.get_surface()
    3843                elif ScreenChange.matches(ev):
    3944                    self.change_screen(ev.screen)
Note: See TracChangeset for help on using the changeset viewer.