pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
pygame-console

pygame-console - 0.7

John Schanck (jmschanck)

Tags:

Description

pygame-console provides a console similar to the one found in games such as Quake 3, which can be imbedded into any pygame application.

Changes

I'm making a release more or less as an incentive for me to keep the project alive. Fixed several bugs (those mentioned in the comments from the last release at very least) and added the ability for developers to define their own syntax using regular expressions.

Links

Home Page: http://sourceforge.net/projects/pygame-console
Source: http://sourceforge.net/project/showfiles.php?group_id=174718

Screenshot


click to view original size

Releases

pygame-console - 0.7 - Dec 2, 2006
pygame-console - 0.5 - Sep 13, 2006
pygame-console - 0.2 - Aug 17, 2006
pygame-console - 0.1 - Aug 11, 2006

Pygame.org account Comments

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

December 23, 2010 11:02pm - Robert Leachman - nickname: (quazar) - 5/5
I used this in Produce Defend Win and it's great (I mean your lib, my game was just fun)
November 24, 2009 6:07pm - Marco Baxemyr - nickname: (phelerox) - 5/5
Very nice! Thanks!
August 22, 2009 6:41pm - Chris Weisiger - nickname: (derakon)
Hey, thanks for writing this! I made some changes to integrate it into my project and make turning the console on and off easier. Among other things this made the preserve_events option pointless, but that's fine. I thought I'd include the diff just so you can see what I did:

44c44
< font_path = os.path.join(path, "fonts")
---
> font_path = os.path.join(path, 'data', 'fonts')
134c134
< self.font = pygame.font.Font(os.path.join(font_path,"default.ttf"), 14)
---
> self.font = pygame.font.Font(os.path.join(font_path,"MODENINE.TTF"), 14)
479c479
< def process_input(self):
---
> def process_input(self, eventlist):
483,489d482
< if not self.active:
< return;
<
< if self.preserve_events:
< eventlist = pygame.event.get(KEYDOWN)
< else:
< eventlist = pygame.event.get()
492c485,488
< if event.type == KEYDOWN:
---
> if event.type == KEYUP and event.key == K_BACKQUOTE:
> self.set_active()
> return
> elif self.active and event.type == KEYDOWN and event.key != K_BACKQUOTE:
October 31, 2006 9:02am - David Eyk - nickname: (eykd) - 4/5
Looks interesting, but that bit of os.chdir magic at the beginning clobbers the path when I import it. I need to be able to find my config files too. :) (It's an easy fix if you just store the absolute path in a variable and use that throughout.)

Also, the test script in the download (and now pyconsole itself) is failing on a division by zero error, line 133 in __init__:

self.max_lines = (self.size[HEIGHT] / self.font_height) - 1

The font height isn't being set correctly?
October 18, 2006 10:24am - captp - nickname: (bdcht) - 3/5
Nice work.
Still, I had to redefine c_shiftmap for european keyboards and change
key range from (32,127) to (32,256)... hum, I guess this should be handled more
properly inside Console (my hack is baaaaaad). Maybe have a look at the pyconsole (uses pygtk) which does not have this "problem".
September 16, 2006 5:04pm - Christopher Smith - nickname: (maximinus)
Thumbs up to the author for quick feedback. Hopefully there'll be some more development on this. At the moment it's merely very good, whereas it could well become excellent!
September 14, 2006 4:54pm - John Schanck - nickname: (jmschanck)
Chris I sent you an email detailing why this is happening, but for anyone else that experiences this, the problem is that the event queue is filling up because you're not handling things like mouse events. Just set preserve_events to False in pyconsole.cfg, or change your code to handle the other events.

The font included is Bitstream Vera Sans Mono which is released under a free license.
September 14, 2006 5:44am - Christopher Smith - nickname: (maximinus) - 4/5
Nice and easy to put in a project - very nice code. However, when I place it in my code, it hangs after 47 characters have been input.
Also, what is the license on the font included?
August 31, 2006 7:11pm - Jerry Heiselman - nickname: (jheiselman)
Great! How can I find out when a the new release is ready?
August 25, 2006 3:07pm - John Schanck - nickname: (jmschanck)
Ok I worked on the performance a bit and now the framerate drop is pretty insignificant (the drop is the same as if you were just blitting anything the size of the console to the screen). I'll make a new release soon.
August 24, 2006 1:18pm - Jerry Heiselman - nickname: (jheiselman)
The anonymous posts on Aug-23 and today at 8:21 AM are by me. I thought this site would set a cookie, but it does not. Anyway, I'll remember to login before posting anymore.
August 24, 2006 8:21am - Anonymous - nickname: () - 5/5
Here is the code that is using pyconsole. The pyconsole code itself has only been modified in that we removed the Ctrl-D to exit the game and changed the Ctrl-W to Ctrl-~.

http://www.heiselman.com/awesome.py.txt
August 23, 2006 1:20pm - Anonymous - nickname: ()
Thanks for the positive response. There really shouldn't be a drop in framerate at all when the console isn't being displayed. That's because both Console.process_input() and Console.draw() check to make sure the console is active before doing anything. Is there any way I can take a look at your code?
August 23, 2006 10:49am - Anonymous - nickname: () - 4/5
Great implementation. Seems very useful, however, I've noticed that with the console code in my game, my FPS drops significantly, even without the console being displayed! Is there a reason for that? Perhaps I'm implementing it wrong or something.
August 17, 2006 5:56pm - John Schanck - nickname: (jmschanck) - 5/5
Sorry about that Michael, I had accidentally included a font which I had been using for testing, the license of which I was unsure of. To be safe I took the file down, but it's back up now and I'd love for you or anyone else to try it out and give me some feedback.
August 16, 2006 3:36am - Michael Brunton-Spall - nickname: (mibgames) - 1/5
No files on sourceforge and no code in the CVS. If I cant get this, I cant try it
spotlight

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


Nov 13, 2014

Nov 11, 2014


Nov 10, 2014

Nov 9, 2014

Nov 6, 2014


Nov 4, 2014

Nov 3, 2014

Oct 28, 2014

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