[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Switching between fullscreen and windowed mode?
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Switching between fullscreen and windowed mode?
- From: "Joseph Quigley" <cpu.crazy@xxxxxxxxx>
- Date: Wed, 25 Oct 2006 22:26:08 -0600
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Thu, 26 Oct 2006 00:26:24 -0400
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=qoauRBQaOC5aZ5h0UVz6niL+Q9Xhkq5SFAsVdz8HkmgpHvdSO4M004hCOWJBHyyJNEXdlTs6Uc9uRs5zJSyM3GzbfPoyu+JXwKuM1I7azqXv0S8c242Ss+JP/fGXF5BghM1MR9CES/qMjL7B1Q0wHDfvKvNZXzpZDnXUQS9i8B0=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
How can I switch between windowed and fullscreen mode? I don't want to
use pygame.display.toggle_fullscreen (because it doesn't seem to work
with my code) and pygame.display.set_mode(resolution,
pygame.FULLSCREEN) doesn't make a windowed version of my game when I
restart it.
Here's the some of the code I'm currently trying to get to work:
if e.key == K_F10:
isFullScreen = self.settings['fullScreen']
isFullScreen = int(not isFullScreen)
# try to change the mode
base.setScreenMode((0,pygame.FULLSCREEN)[isFullScreen],int(self.settings['bpp']))
# save changes
self.settings['fullScreen'] = isFullScreen
base.saveGameSettings(self.settings)
return 1
self.settings["fullscreen"] can be either 1 for True or 0 for False.
Thanks,
Joe
--
All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.'' --
Tao of Programming Book 2