954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

More pygame trouble. Toggle window not working.

sorry about my post on pygame, but i'm having more trouble. frist off im ending the simple program that opens a window with
if event.type == QUIT:
raise SystemExit
That makes a window pop up asking me if i want to quit. Is there another way to exit the window?

I also figured that be able to toggle to fullscreen would help when making a game. I'll do something like
elif event.type == KEYDOWN and event.key == K_ESCAPE:
pygame.display.toggle_fullscreen()
and nothing happens. I havent had much time to look this up.
Thanks

TheSkunkMan
Newbie Poster
6 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

To quit your game try something like ...

pygame.quit()


This will clean things up before quitting.
I know sys.exit() works, but you have to import sys.

On your second problem I can only guess. You may need to update your screen with a ...

pygame.display.flip()
vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You