Combine PySide and PyGame

I want to develop a user interface containing both forms for the user to customize the application, as well as the “rendering” part, which, for example, prints some sprites.

Is it possible to combine PySide and PyGame in one application? For example, how can I get a PySide package containing a Pygame application?

thanks

+6
source share
1 answer

The simplest, most natural solution is probably just a QGraphicsView . For instance. for sprites, implement a subclass of QGraphicsItem and override the paint () function to display the corresponding frame.

If you absolutely insist on using PyGame, you can easily run the PySide and PyGame bits in separate windows. For embedding PyGame in a PySide widget, this will probably be much more complicated, and PySide widgets will not gel as smoothly (you can actually insert GUI elements such as buttons inside , QGraphicsView and convert them!).

0
source

Source: https://habr.com/ru/post/949862/


All Articles