Pygame embedded in wxPython
A demo showing how to embed Pygame in wxPython applications.
David
(animatinator)
I've been looking into getting wxPython working with Pygame for a while now, as one of my future projects will involve a fairly complicated interface which would be far too difficult to implement using Pygame alone. Unfortunately this was easier said than done as there appears to be just one example on combining the two, and it's far from perfect - it doesn't show how you would have Pygame running constantly (just how to play a video), and closing the window throws several errors.
So, after a lot of faffing around with messy code and duelling with screens of error messages, I've managed to get this basic demo working. It's not entirely finished yet as there's no real event handling involved (I haven't decided whether it would be best to let wx handle all events or to try and get Pygame to process the ones occurring within its window), but I hope it'll make the process of combining Pygame and wxPython a bit easier. Any comments are welcome, and give me a shout if any problems crop up.
So, after a lot of faffing around with messy code and duelling with screens of error messages, I've managed to get this basic demo working. It's not entirely finished yet as there's no real event handling involved (I haven't decided whether it would be best to let wx handle all events or to try and get Pygame to process the ones occurring within its window), but I hope it'll make the process of combining Pygame and wxPython a bit easier. Any comments are welcome, and give me a shout if any problems crop up.
Changes
Links
- Home Page
- http://www.pygame.org
Releases
Pygame embedded in wxPython 1.5 — 21 Jul, 2010
Pygame embedded in wxPython 1.0 — 14 Jul, 2010
Pygame.org account Comments
-
benjamin friman 2011-12-15 09:41
Brilliant. I gave up on pygame a while back because I couldn't get a frameless window to be draggable and resizeable. Now I can do that so a project is revived! Thanks.
-
Steven 2012-01-26 18:28
man, this is revolutionary! Develop this further
-
JoryRFerrell 2012-03-03 18:41
Thanks for this example. Very cool.
-
online 2018-05-04 10:15
Here the many stage if you like to join board online i am the big fan this most amazing yahtzee such the amazing video game for the all players so try this once time and have the most fun forever so that the golden chance for you. -
- 2018-06-19 21:32
I modified and removed all deprecated methods for the version 1.5: you can check it out [here](https://gist.github.com/Skycocoo/1137bafdaf8c1f4d2303a6292b19532d)