pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
PGU - Phil's pyGame Utilities

PGU - Phil's pyGame Utilities - 0.10.5

Peter Rogers (petros)

Tags:

Description

A collection of handy modules and scripts for PyGame.

tools

  • tileedit -- edit tga based images
  • leveledit -- edit tga based levels in tile, isometric, and hexagonal formats
  • tganew -- create tga files
  • levelfancy-- prettyify your levels

gui

  • gui -- gui with standard widget, dialog, connections, and themes
  • html -- html rendering utilities
  • layout -- layout utilities
  • text -- text rendering utilities

game libs

  • tilevid -- sprite and tile engine
  • isovid -- isometric sprite and tile engine
  • hexvid -- hexagonal sprite and tile engine
  • engine -- state engine
  • timer -- a timer for games with set-rate FPS
  • high -- high score tracking
  • ani -- animation helpers
  • algo -- helpful pathfinding algoritms
  • fonts -- font wrappers, bitmapped fonts

Changes

- added: support for style loading .ini files 
[link]
color: red
..
[link:hover]
color: blue
.. etc ..
- changed: filedialog now uses the dialog class for most all of its
parts.  main style change is that
filedialog.title.label => dialog.title.label
and all other filedialog items are gone, except for 
filedialog.folder
- changed: filedialog style requirements to be much simpler.  in general
it just uses dialog and default labels, etc now.
- fixed: some excessive repaints going on due to use of chsize() before a paint().
now chsize() doesn't do anything until after the widget is painted at least once.
- fixed: some code in VScroll, HScroll that was causing extra resizes within tables
for no particularily good reason.
- fixed: menu not working bugs 
- changed: menu so that the cls of a menu doesn't change, it just keeps
the down pcls while down.
- fixed: bug where get_abs_rect() was wrong due to theme stuff... kind of a HACK
- added: shift-TAB for previous support
- fixed: bug where TAB could cause a crash if no non-container widget
    was in focus at the time.
- changed: added support for width,height scaling for Image widgets
- changed: improved caching of style data so that complex screens repaint much quicker (removed .cache() method from style object)
- changed: misc changes to add better keyboard / nav support to many widgets (selects, sliders, etc)
- added: ability to move between widgets via arrow keys .. to stop this behaviour, make sure the
widget that has focus returns True to say that it "already used the event"
- changed: after an event() handler, user should return try if they used
    the event.  otherwise a container may use the TABS, arrow keys, etc for
    navigation or other purposes.  somewhat optional, will only impact
    widgets that use tabs/arrow keys ATM.
- added: a Link widget
- fixed: bug where pygame would crash if full screen was toggled 
- fixed: some style issue in the select widget
- fixed: some rendering issues with sliders being off by a few pixels
- fixed: some icon styling bugs due to incorrect init order.. but i'll still probably
    deprecate it anyways! ha!
- fixed: backgrounds of widgets that are getting repainted, etc.
- fixed: disabled backgrounds that didn't appear correctly

0.10.4 -
- fixed: bug in dialog.py -- directories with '!' at beginning were being sorted after '..'
        thanks Jason Liu for this patch
- fixed: bug in high.py
- fixed: scrollbars scroller not the right size

Links

Home Page: http://code.google.com/p/pgu/
Source: https://sourceforge.net/project/showfiles.php?group_id=145281

Screenshot


click to view original size

Releases

PGU - Phil's pyGame Utilities - 0.16 - Mar 16, 2011
PGU - Phil's pyGame Utilities - 0.14 - Jan 3, 2011
PGU - Phil's pyGame Utilities - 0.12.2 - Mar 1, 2009
PGU - Phil's pyGame Utilities - 0.12.1 - Feb 23, 2009
PGU - Phil's pyGame Utilities - 0.10.6 - Mar 25, 2007
PGU - Phil's pyGame Utilities - 0.10.5 - Sep 1, 2006
PGU - Phil's pyGame Utilities - 0.10.3 - Apr 7, 2006
PGU - Phil's pyGame Utilities - 0.10.2 - Mar 13, 2006
PGU - Phil's pyGame Utilities - 0.10.1 - Feb 24, 2006
PGU - Phil's pyGame Utilities - 0.10 - Feb 11, 2006
PGU - Phil's pyGame Utilities - 0.9 - Dec 1, 2005
PGU - Phil's pyGame Utilities - 0.7 - Nov 19, 2005
PGU - Phil's pyGame Utilities - 0.6 - Oct 24, 2005
PGU - Phil's pyGame Utilities - 0.5 - Oct 7, 2005
PGU - Phil's pyGame Utilities - 0.3 - Aug 25, 2005
PGU - Phil's pyGame Utilities - 0.1.0 - Aug 4, 2005
PGU - Phil's pyGame Utilities - 0.1.0pre - Jul 24, 2005

Pygame.org account Comments

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

November 18, 2011 3:29am - J - nickname: (dobus)
And I've got python 2.6 with pyGame running fine.
November 18, 2011 3:28am - J - nickname: (dobus)
How do you install PGU on Windows 7? Just running setup.py doesn't seem to do it.
March 16, 2011 8:18pm - Ken Lauer - nickname: (kne)
Great! I'm glad to see Python 3 support.
February 18, 2011 12:10am - Muhammad Ahmad Tirmazi - nickname: (burningprodigy)
I have added your utilities along with my game for the convenience of downloaders.
I have given you full credit for the work. See: http://code.google.com/p/prodigypong/downloads/detail?name=Prodigy%20Pong%202.zip&can=2&q=#makechanges

If you have any objection just tell me and i will remove them immediately
January 12, 2011 10:03am - Dave Burton - nickname: (ncdave4life)
Victor, would you mind sharing your Python3 work with me? You've obviously gotten further down that trail than I have. My email address can be found here:
http://www.burtonsys.com/email/

All I've done so far is this:

pgu\engine.py fixed tab/space mismatch (converted tabs to blanks)
pgu\text.py fixed tab/space mismatch
pgu\gui\area.py fixed tab/space mismatch
pgu\gui\input.py fixed text input for Python 3 (char/byte issue) on line 89:
c = e.unicode # was c = (e.str).encode('latin-1')
pgu\gui\table.py fixed a Python 3 bug (None is not equivalent to 0); insert before line 325:
if width == None:
width = 0
if height == None:
height = 0
pgu\gui\textarea.py converted tabs to blanks, and fixed a Python 3 bug (char/byte issue) on line 244:
c = e.unicode # (e.str).encode('latin-1')
pgu\gui\theme.py Fixed a Python 3 bug: integer division is now // instead of / on line 420:
ww,hh=box.get_width()//3,box.get_height()//3
examples\gui6.py added pygame.quit() call at the end
examples\gui10.py added pygame.quit() call at the end
examples\gui11.py fixed tab/space mismatch
January 10, 2011 4:39pm - eduardo zepeda - nickname: (edzep)
I appreciate these utilities by Peter and Phil. Anyone know of a way to put focus on a PGU input box? I've studied the code, and there does not appear to be. But, I may have missed something.
January 10, 2011 3:42am - Victor Kam - nickname: (lingyis) - 5/5
thanks for the update
docs are there, just need to build.py them
i did some simple changes to make it python 3.x compatible, basically, just:
1) 2to3.py
2) fix some indentations
3) some range() issues--floats no longer automatically casted into ints in 3.x
4) max() issues--None type no longer automatically casted into 0
5) htmllib issue: import html.parser instead, use html.parser.HTMLParser. the next step not sure what i did is right, but the p = _html(htmllib.AS_IS,0) line, the new HTMLParser does not need arguments for its constructor so i left those arguments out. the html examples run without crashing, i just don't know if the behavior is as intended for such. anyway, i have no need for the html stuff so i'm pretty happy.
January 9, 2011 5:23pm - Gregor Lingl - nickname: (glingl)
It seems to me that in PGU 0.14 the docs are missing.
Regards, Gregor
January 4, 2011 7:53pm - Peter Rogers - nickname: (petros)
Okay folks, sorry for the delay in releases. The latest (0.14) should fix many of the problems people have been having.

If you checkout the googlecode site, there's an issue tracker you can use to submit bug reports and whatnot.
January 4, 2011 9:51am - Donpachi - nickname: (donpachi) - 5/5
Great work, it's the first pygame library that stuck with me. Now I can't do anything without it anymore.
September 28, 2010 9:04pm - Carlos Guidobono - nickname: (masterguido)
Where can I find info about pgu? Properties, methods, classes?
Thank you
April 19, 2010 4:25pm - Niriel - nickname: (niriel)
I'm having troubles with the last version: 0.12.2. ComboBoxes (gui.Select) won't unfold but will crash with a "Button instance has no attribute '_container_bkgr'". Also, menu items are properly shown the first time I click on the menu, but after the first time they'll be invisible until I move my mouse cursor above them.
April 11, 2010 2:48am - Amey - nickname: (szcukg)
I have a gui button.When a button click happens I want to load a new python script which should blit the current page.How can I do this
April 11, 2010 12:46am - Karanveer Singh - nickname: (kvsingh) - 5/5
I'm having a problem. Basically I want to do collision detection of 2 sprites with the same type of tiles. So, I don't know what to enter in the tdata dictionary. I tried entering both sprites, but it only does collision detection for the sprite entered later. How can I do collision detection for both the sprites with the same type of tiles?
March 30, 2010 6:28am - Connor Walker - nickname: (awesumo)
i am getting the same error as "supersailor7"
i am running it of the command prompt and it seems every command i put after the file location leads to it returning that it cant find the folder 'pgu'
March 17, 2010 12:40am - Jordan Magnuson - nickname: (jordanmagnuson)
Is this module still being maintained? Does it work with the latest version of PyGame (1.9.x)?
February 8, 2010 6:41am - stas - nickname: (stas)
As I can't seem to find the current maintainer of pgu I'll try this comments list.

The changelog above mentions that the container.remove bug is fixed but it's still there in version 0.12.3.
The widget is still shown at the screen, it's not functional, but still visible.

September 4, 2009 12:18pm - Marco Baxemyr - nickname: (phelerox)
pywiz32: There's a 0.12.3 version here http://code.google.com/p/pgu/

No idea what it does, but try and hope? I hope there will be a fix in time for my upcoming project! :)
August 24, 2009 12:48pm - Anonymous - nickname: (pywiz32)
A new problem has risen from the new version of pygame: the menus only open once. Basically, you can open them, but after you close that menu, it won't re-open.
June 15, 2009 11:11am - Chris Carton - nickname: (ctcarton)
I get this exception when running the examples:

File "../pgu/gui/theme.py", line 483, in paint
if isinstance(v, pygame.Color) or type(v) == tuple:
TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types
April 13, 2009 9:54am - Roman Lavrov - nickname: (rlavrov)
Surprisingly mouse wheel is not supported in GUI.
Here is a patch fixing this:
http://code.google.com/p/pgu/issues/detail?id=3
March 23, 2009 11:27am - Claudio Canepa - nickname: (claxo)
petros, are you tracking the issues in the project page ?
March 1, 2009 12:08pm - Peter Rogers - nickname: (petros)
This sounds like an issue with the old version of PGU (0.11.6) - could you make sure you've installed the latest version?
February 24, 2009 9:24pm - liam mcadney - nickname: (liam)
I am doing a starter example like:

from pgu import gui
app = gui.App()
e = gui.Button("hello world")
app.run(e)

and i keep getting this error: AttributeError: 'int' object has no attribute 'size' ---- what am i missing??
February 24, 2009 4:21pm - Claudio Canepa - nickname: (claxo)
Glad pgu is active again.
Theres a potential bug lurking in the actual package(0.12.1), wich manifest in the example gui9.py ( circles and boxes dont draw ).
Look at the thread http://thread.gmane.org/gmane.comp.python.pygame/15580 for more info
February 23, 2009 11:56pm - Ken Lauer - nickname: (kne)
Good to see someone's maintaining this now. Keep up the good work.
February 2, 2009 11:31pm - Mako Kino - nickname: (supersailor7)
When I attempt the install (with the "setup.py install" command) I get the error message "error: package directory 'pgu' does not exist." But there IS a folder "pgu" in the directory. Now what?
January 1, 2009 3:11pm - Anonymous - nickname: (pywiz32)
While using pgu, I found several areas of possible improvement. 1: you can't put several connections per event. the way you do it, you can have one per event. It would help to have several possible. 2: function calls from connected events don't work if it's built-in. Built-ins don't have function codes, and pgu requires them. It would be great to fix this.
March 19, 2008 1:26pm - John coyne - nickname: (coynemultimedia)
Try opening a dos window, navigate to the PGU dir and type "setup.py install".
It worked for me.
February 7, 2008 8:03am - AN - nickname: (an) - 5/5
pymike, use 7-zip.
if you can't install software, use 7-zip portable on a usb stick.
Even though it is an installer, it only extracts files.
December 3, 2007 5:14pm - pymike - nickname: (pymike)
Can you release a zip download so I can use it? I can't unpack .gz files.
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 13, 2014

Nov 11, 2014


Nov 10, 2014

Nov 9, 2014

Nov 6, 2014


Nov 4, 2014

Nov 3, 2014

Oct 28, 2014

Oct 21, 2014

Oct 16, 2014

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