EasyPygameWidgets
An easy-to-use UI widget library for pygame, featuring customizable buttons, sliders, text entries, screen management and much more.
Features
- easy integration: seamlessly works with existing pygame projects
- customizable widgets: nearly infinite styling options for colors, sounds, cursors, and more
- screen management: built-in screen system for creating different GUIs
Installation
Windows
pip install easypygamewidgets
Linux/macOS
python3 -m pip install easypygamewidgets
Quick Start
import pygame
import easypygamewidgets as epw
pygame.init()
window = pygame.display.set_mode((800, 600))
clock = pygame.time.Clock()
# link the pygame window
epw.link_pygame_window(window)
# create a button
button = epw.Button(text="Click Me!")
button.place(300, 100)
# create a slider
slider = epw.Slider(text="Volume", start=0, end=100, auto_size=False, width=300)
slider.place(300, 200)
# create a text entry
entry = epw.Entry(placeholder_text="Type here...", auto_size=False, width=250)
entry.place(300, 400)
def draw():
window.fill((30, 30, 30))
# main game loop
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
# handle widget events
epw.handle_event(event)
# handle special widget events
epw.handle_special_events()
# draw all widgets
epw.flip(draw)
pygame.display.update()
clock.tick(60)
pygame.quit()
Widgets Documentation
All examples will use the same start template code.
Screen
A container for managing groups of widgets with shared visibility and state.
Button
A customizable button widget to run commands when interacted.
Slider
A slider for selecting values within a specific range.
Entry
A text entry with selection and clipboard support.
Label
A text display that can be used to drag it into places or show text.
Surface (images etc.)
This converts your pygame surfaces into an easypygamewidgets widget that can be used in screens. (All pygame surface commands can be applied to the "surface" attribute of your widget.)
Timekeeper
A text display that can show a timer or stopwatch.
Tooltips
A text display that is only shown when you hover over a widgets.
Module Functions
Core Functions
# link your pygame window (required before using widgets)
epw.link_pygame_window(pygame_window)
# handle pygame events (call in event loop)
epw.handle_event(pygame_event)
# handle special events (call outside event loop)
epw.handle_special_events()
# draw all widgets to the linked window
epw.flip()
Examples (COMING SOON)
Check the examples directory for complete working examples:
- all widgets example - simple demo of all widgets
- **screens with animations ** - multiple screens with transitions
- settings screen - interactive settings panel with sliders
- login form - form with entries and validation
- bindings - binding events to widgets
Requirements
- python
- pygame
- requests (for update checking in background once)
I recommend using the latest version of libraries.
Contributing
Contributions are welcome! Please feel free to submit a pull request. Of course will be mentioned :)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
-
Issues: GitHub Issues
-
Discord: My Account
-
Instagram: My Account
-
License: MIT
-
History: GitHub History
Made with ❤️ by PizzaPost
Metadata
Release files for easypygamewidgets 26.32
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| easypygamewidgets-26.32.tar.gz | 763.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| easypygamewidgets-26.32-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.5 MB
Release files / easypygamewidgets-26.32.tar.gz
| Download URL | easypygamewidgets-26.32.tar.gz |
|---|---|
| Size | 763.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a48eda70dc3ce94fae2c9cc5efa51d8c76ba6cf29a6f3cbc08483c47529c0249
|
|
BLAKE2b-256 checksum How to use checksums |
389a99b061de0802eb06584223a5a054ff22fb3057bc6adf5495a62137c25fa8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / easypygamewidgets-26.32-py3-none-any.whl
| Download URL | easypygamewidgets-26.32-py3-none-any.whl |
|---|---|
| Size | 786.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ccdb7917af59350d2483466cbd5863c51d6e7ec5ef667c892998b3bbb29b6e99
|
|
BLAKE2b-256 checksum How to use checksums |
1d70bfcca1201802f16dc5112d9dfa471c0bfe05b20dfb434d52ae76266cbfd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|