Documentation - Home Page

Pygame GUI is a module to help you make graphical user interfaces for games written in pygame. The module is firmly forward looking and is designed to work on Pygame 2 and Python 3.

Features

  • Theme-able UI elements/widgets - you can use JSON theme files to change the colours, fonts and other appearance related details of your UI without touching your code.
  • A subset of HTML is supported for drawing word-wrapped text. Have bold styled words in the middle of a paragraph of text! Stick a link in there! Go absolutely hog wild, within the bounds of the defined subset of HTML the module supports.
  • Buttons, text entry, scroll bars and drop down menus all supported, with more on the way.
  • A window stack that will let you keep a bunch of moveable windows of 'stuff' around and correctly sorted.
  • Support for localizing your GUI into different languages.
  • As closely respecting of the pygame way of doing things as possible.

Installation

Install the latest release from PyPi using pip with:

pip install pygame_gui -U

Or, you can build the latest version from GitHub here by downloading the source, navigating to the project's directory (the one with setup.py in it) and then building it with:

python setup.py install
pip install . -U

Why is your package called pygame-gui on PyPI?

PyPI converts all non-letter characters in package names to dashes for web search optimisation reasons. I can assure you that the pygame-gui package on PyPI is this library pygame_gui. Conversely, Python does not allow dashes in package names. So it is not possible to standardise around either convention unless you forgo any kind of non-lowercase letter, pygamegui is already taken as a name on PyPI - so here we are.

Please live with the inconsistency.

Source code on GitHub

The source code is available from GitHub here .

Getting Started

Try our Quick Start Guide here if you are new to Pygame GUI. Check out the Theme Guide if you want to learn how to style your GUI.

Examples

If you want to see Pygame GUI in action have a rifle through the examples project over on GitHub to see some of the stuff the library can do in action.

Game projects using Pygame GUI

Indices and tables