For games, it is usually preferrable to not have your game within
a GUI framework. This GUI framework can be placed within your game.
You can initialize the screen yourself.
19:screen = pygame.display.set_mode((640,480),SWSURFACE)
Using App instead of Desktop removes the GUI background. Note the call to app.init()
70:app = gui.App()
71:t = StarControl()
72:
73:c = gui.Container(align=-1,valign=-1)
74:c.add(t,0,0)
75:
76:app.init(c)
You can include your own run loop.
139:_form = form.results()
140:reset()
141:_quit = 0
142:while not _quit:
143: if form['quantity'].value != _form['quantity']: adjust(form['quantity'].value-_form['quantity'])
144: if form['fullscreen'].value != _form['fullscreen']:
145: pygame.display.toggle_fullscreen()
146: _form = form.results()
147:
148: screen.fill((0,0,0)) #clear the screen
149: render() #renders the starfield
150: for e in pygame.event.get():
151: if e.type is QUIT: _quit = 1
152: if e.type is KEYDOWN and e.key == K_ESCAPE: _quit = 1
153: app.event(e)
154: app.paint(screen)
155: pygame.display.flip()
156: pygame.time.wait(10)