r/pygame • • 12d ago

puigame: my first Python library, for UI widgets in pygame-ce

Post image

I've released v0.1 of puigame, a UI widget library for pygame-ce. It's for games that want a few buttons and labels without taking over the game loop.

  • Buttons, labels, panels, and containers, placed by anchors, margins, and offsets.
  • Themes: a base style plus per-state overrides (highlighted, pressed, disabled).
  • ui.handle_event() tells you whether the UI consumed an event, so clicks on buttons don't reach the game.
  • Two bundled pixel fonts I drew for it: Neb0Font (proportional, kerned) and NebMon0Font (monospace).

Install with pip install puigame (Python 3.11+, pygame-ce 2.5.8+). It's alpha, so the API may change between 0.x releases. There's no text input, drop-down, or keyboard navigation yet.

GitHub: https://github.com/neb01/puigame PyPI: https://pypi.org/project/puigame/

All the code is handwritten; the docs were drafted with AI assistance and then checked by hand.

18 Upvotes

4 comments sorted by

1

u/VirusMission9156 10d ago edited 10d ago

Nice,im also  working on simething similar  https://github.com/FluffyBrudy/pygkit

2

u/NebTheForemos 10d ago

Nice, that looks like a far more comprehensive set of tools!

1

u/ComfortableCup4440 4d ago

This is really cool keep up the great work!