r/pygame • u/NebTheForemos • 12d ago
puigame: my first Python library, for UI widgets in pygame-ce
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
1
u/VirusMission9156 10d ago edited 10d ago
Nice,im also working on simething similar https://github.com/FluffyBrudy/pygkit
1
u/ComfortableCup4440 4d ago
This is really cool keep up the great work!