pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
dumbmenu

dumbmenu - 0.40

Manuel Kammermeier (astorek)

Tags:

Description

It's another Module to create a Textmenu in a simple way... The Code isn't OOP, just procedual, and the sourcecode... Well, it could be better :) The Downloadable ZIP-File includes the Module and a simple Example; Documentation is the DocString [import dumbmenu; help('dumbmenu')] Maybe someone can use it?...

Links

Home Page: http://astorek.bplaced.net/downloads/dumbmenu.zip
Source: http://astorek.bplaced.net/downloads/dumbmenu.zip

Screenshot


click to view original size

Releases

dumbmenu - 0.40 - Jul 17, 2010

Pygame.org account Comments

If you wish to leave a comment with your pygame.org account, please sign in first.

March 27, 2011 1:38pm - Maxime - nickname: (spacemax) - 4/5
Very good. It will be perfect if you just add an additional option to center the text.
December 29, 2010 8:57pm - Magnus L - nickname: (magnet) - 5/5
I found a much better method to check for keys!
code:

cursorpos = -1
x=1
while x <= len(menu):
if event.key == x+pygame.K_1:
cursorpos = x
ArrowPressed = True
exitMenu = True
break
x=x+1

It should work on any machine linux or windows!
July 18, 2010 2:43am - root9885 - nickname: (root9885) - 3/5
i can't download it from the link~ plz check
March 2, 2010 3:23am - Manuel Kammermeier - nickname: (astorek)
@gio: A Quick'n Dirty (and a VERY ugly) Solution would be:

p = dumbmenu(...)
if p == 0: main(); exit

But I'm sure this is not recommended^^. Typically, I'm use the dumbmenu with an endless While-Loop. The only Possibility to exit the While-Loop is choosing the "right" Menupoint. If another Menupoint was choosen, another function will be called. For example:

loopAgain = True
While loopAgain:
screen.fill((0,0,0))
p = dumbmenu(screen,['Start Game','Manual','Quit Game'])
if p == 0: showManual() # Called another function named "showManual"
elif p == 1: startGame() # Called a function named "startGame"
elif p == 2: loopAgain = False # Exit the While-Loop

Hope I could help :)
March 1, 2010 5:34pm - Gio Di Russo - nickname: (bulbear4444)
How would I make it so when the user selects something, it goes to main()?
February 26, 2010 9:21am - Manuel Kammermeier - nickname: (astorek)
Argh, I released that under the wrong license, Sorry about that. The correct License is the "MIT-License". That means: You can do with the program whatever you want - in theory, you could even sell it if you want to do that ;) .
February 26, 2010 7:07am - Gio Di Russo - nickname: (bulbear4444) - 5/5
Very nice. Is it OK if I include the module with a Game Package I'm making?
February 25, 2010 11:40am - the new gammer - nickname: (ok14azertycmoi) - 4/5
it' s cool
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Sep 29, 2014

Sep 19, 2014

Sep 17, 2014

Sep 9, 2014

Sep 8, 2014

Sep 7, 2014


Sep 5, 2014

Aug 26, 2014

Aug 21, 2014


Aug 18, 2014

... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)