pygameshort
A user interface extension library for Pygame with built-in networking capabilities.
Features
-
Enhanced UI Components
- Button system with hover and click effects
- Input boxes with full text editing capabilities
- Smooth animations and transitions
- Customizable color schemes and themes
-
Advanced Text Handling
- Multi-line text support
- Text selection and manipulation
- Copy/paste functionality
- Undo/redo system
-
Integrated Networking
- Seamless integration with secure_network library
- Easy-to-use connection management
- Event-based network communication
- Built-in security features
-
Flexible Layout System
- Box-based positioning
- Size and position matrices
- Automatic text wrapping
- Responsive design capabilities
Installation
pip install pygameshort
Dependencies
- pygame
- secure_network
- pyperclip
Roadmap
- ✔️ Uses secure networking package by me
- ✔️ Window, plus managers
- ✔️ Event manager / distrebutor (Tickets)
- ✔️ All events are gathered into one event flow
- ✔️ Cooldown class
- ✔️ Cursor system
- ✔️ Systems for metrical values
- ✔️ Systems for fonts and color values
- ✔️ Object system(s)
- ✔️ Fully functional text (input) system
- ✔️ Easily made custom objects
- ✔️ Buttons
- ✔️ Input Box
- ❌ Sliders
- ❌ Loading bars
- ❌ Movable, resizeable, closable ..etc.. windows
- ❌ Drag and drop
- ❌ Tab system
- ❌ Layout manager
- More to be added!
Quick Start
import pygameplus as pgp
# Create a window with networking
key = pgp.Key(b'I\xebi\xc3U\xa47\x85I%I@9\xf9b\ry\x807Fq\x1aj\x15585\xf8P\xc45\xb7H\xccg\x0fs\x92s\xd70\xd2o\x9fw\x83J/lt-\x03R\xb1Q^H\xf1O\xadQ 0\xe1') # Leave empty to generate a new
fernet_key, hmac_key = key.extract()
conn = pgp.Connection(fernet_key, hmac_key, "localhost", 8000, pgp.secure_network.CLIENT)
# Initialize window
window = pgp.Window("My App", conn, on_render=lambda: None)
# Create a button
button = pgp.Button(
text="Click Me!",
box=pgp.Box(100, 100, 200, 50),
color=pgp.ColorData.create_light_theme(),
font=pgp.FontSet().load_system_font("Arial", (12, 16, 24)),
border_radius=5,
border_width=2,
switch=False,
callback=lambda: print("Button clicked!")
)
# Create an input box
input_box = pgp.InputBox(
text="Enter text...",
box=pgp.Box(100, 200, 200, 50),
color=pgp.ColorData.create_light_theme(),
font=pgp.FontSet().load_system_font("Arial", (12, 16, 24)),
border_radius=5,
border_width=2
)
# Create a scene
scene = pgp.Scene([button, input_box])
# Set up render function
def render():
window.screen.fill((255, 255, 255))
scene.draw()
window.on_render.append(render)
# Start the application
# Use "window.connect()" whenever you want to connect using the connection
# Remember to set the address correctly first
# Also remember to then auth with a username and a correlating password
window.run()
UI Components
Button
The Button class provides a customizable button with:
- Hover effects
- Click animations
- Toggle functionality
- Smooth size transitions
InputBox
The InputBox class offers a full-featured text input with:
- Text selection
- Copy/paste support
- Cursor management
- Multi-line support
- Word wrapping
Window
The Window class serves as the main container and provides:
- Event management
- Scene rendering
- Network integration
- Frame rate control
Networking
The library integrates with the secure_network package for encrypted communication:
# Create a secure connection
key = pgp.Key()
fernet_key, hmac_key = key.extract()
conn = pgp.Connection(
fernet_key,
hmac_key,
"localhost",
8000,
pgp.secure_network.CLIENT
)
# Send data
conn.send("Hello, server!")
Themes
pygameshort includes built-in theme support:
# Light theme
light_theme = pgp.ColorData.create_light_theme()
# Dark theme
dark_theme = pgp.ColorData.create_dark_theme()
Contributing
-- To be added --
Contributions are welcome! Please feel free to submit a Pull Request.
License
[Add your chosen license here]
Author
Neo Zetterberg
- Email: 20091103neo@gmail.com
Acknowledgments
Built on top of the excellent Pygame library | Uses secure_network for encrypted communication
Metadata
Release files for pygameshort 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pygameshort-1.0.2.tar.gz | 15.5 kB | Without provenance | Details for pygameshort-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pygameshort-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for pygameshort-1.0.2-py3-none-any.whl |
Total release size: 29.1 kB
Release files / pygameshort-1.0.2.tar.gz
| Download URL | pygameshort-1.0.2.tar.gz |
|---|---|
| Size | 15.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
87954845d2e8feef048bdde2e53988f779a1809ba60f42e5cca045f4a386bbf0
|
|
BLAKE2b-256 checksum How to use checksums |
499a95bf5d99a75d7b2d14e97fb19d7817ff7e24c94a59978ed08f1accb15b4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Release files / pygameshort-1.0.2-py3-none-any.whl
| Download URL | pygameshort-1.0.2-py3-none-any.whl |
|---|---|
| Size | 13.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c38d5e649ea5d1b435bf5ac799c7faaf23f45cd55d360eafb477cc5308f63fa8
|
|
BLAKE2b-256 checksum How to use checksums |
ff441395217d93bc94c2c2cab52ecb37da36374dea813a4d4041d472f2c5a973
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Security for pygameshort 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.