[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] poll: GUI library advice / current GUI info ( for wiki )



Hi jake,

1]  What libraries do you use most?
The first pygame gui I used was gooepy but I think it was a bit buggy and inflexible. Then I tried spg (the first version) which was quite cool but the code was very
unpythonic and thus very hard to hack and extend eg. to write new widgets.
After some time of not using pygame guis I needed one again and thought to write my own small and easy-to-use gui. As nearly always if you plan to write your own small
and easy version of a complicated and complex module X I wrote my own quite
complex pygame gui. But I hope that it is less complicated than others. However, it's still in (more or less) active development and not yet released (there is just a public svn repo at http://tinyurl.com/33oe6xu ) so I'm currently the only user and
haven't got any feedback from "normal" users yet.

2] Advantages to that library, over others? ( Special notes, ie: good with X. GooeyPy uses CSS, etc...)
The 4 most important aspects:
- flexible measurements: Any positions and sizes can be absolute or relative or mixed (eg. "20%+30px"). This allows more flexible layouts since resizing the pygame window won't crash your gui. - flexible styling: Styling can (but don't have to) be done completely distinct from the widgets and changed all the time (i.e. you can change the entire appearance of your gui on runtime). Since styles are cached only widgets with a changed style will be redrawn. The use of pre- and suffixes makes it easy to define different styles for different
                            states (like mouse-over, ...).
- flexible event system: All kinds of callbacks, notifications, etc. are done via events (of an own event system, no pygame user-events are needed). Its easy to send and listen to events and implement any
                                        "communication" this way.
- flexible widget system: Since game UIs may be very individual and game specific its very important to provide an easy way to write new widgets. Thanks to the first three features own widget classes often consist of just a few lines.


3] Disadvantages of those libraries? ( Special notes, ie: hard with X)
The pygame guis I have used were mostly widget sets but no guis. They provide
a set of widgets with styling options (using a (kinda inflexible) predefined
image set) but no (or a very limited) geometry manager and no easy way to extend
them and write own widgets.

4] Recommended games to view for examples?
I've used it for two of my projects recently:
http://tinyurl.com/3ycqe6z

5] Any changes to be aware of in pygreloaded , or already exist that is relevant for GUIs? Hu? pygame2 != pygame. pygame2 has another api and thus guis (and programs/libs in general)
for pygame won't run with pygame2.

7] Anything else?
Pygame (g)uis is a difficult topic. I think lots of people here have their own (mostly private) pygame-utils package and use it to build a new gui for every game. I know of at least two
other guys who started working on their own (generic) gui or ui-helper lib.
So, the ultimate pygame gui is yet to be written.

Regards,
Julian