peng-ui
Basic UI components for a Pygame environment.
Installation
pip install peng_ui
Basic Usage
You can subclass the Viewer class to create a custom UI very quickly.
import pygame as pg
from peng_ui.elements import TextField, EditField, Label, Button
from peng_ui.viewer import Viewer
class MyViewer(Viewer):
def __init__(self):
super().__init__(screen_size=(800, 600))
self.button = Button(pg.Rect(50, 50, 120, 40), "Click Me!")
self.label = Label(pg.Rect(50, 100, 120, 40), "This is text :)")
self.edit_field = EditField(pg.Rect(200, 50, 220, 40), "Edit me...")
self.text_field = TextField(pg.Rect(200, 100, 520, 440), "This is a long text :).\nIt supports multi-lines, copy-paste, selection, ...")
def tick(self):
if self.button.is_clicked:
self.text_field.set_text(self.edit_field.text)
if self.label.is_clicked:
print('label clicked')
if __name__ == '__main__':
viewer = MyViewer()
viewer.run()
To get more finegrained control over the UI, see the implementation of the peng_ui.viewer.Viewer class.
Metadata
Release files for peng-ui 0.3.5
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 |
|---|---|---|---|---|
| peng_ui-0.3.5.tar.gz | 15.1 kB | Without provenance | Details for peng_ui-0.3.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| peng_ui-0.3.5-py3-none-any.whl | Python 3 | none | any | Details for peng_ui-0.3.5-py3-none-any.whl |
Total release size: 33.6 kB
Release files / peng_ui-0.3.5.tar.gz
| Download URL | peng_ui-0.3.5.tar.gz |
|---|---|
| Size | 15.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a5de85ab451c1b152f6339c86e1f8912d8f3cacb05694bfc32f2fad63d4b33c
|
|
BLAKE2b-256 checksum How to use checksums |
7a5cb23315c79f87d24afa096a5c2ceb369a084fe9fc8f9b326a67c7de0a3257
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / peng_ui-0.3.5-py3-none-any.whl
| Download URL | peng_ui-0.3.5-py3-none-any.whl |
|---|---|
| Size | 18.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
458fa8d1ba4c0791012385a8f6b533674a226d4456b73836a02dfc7c85fb9201
|
|
BLAKE2b-256 checksum How to use checksums |
c4a296d2c366dfb2ea3917a4fcc3f24551e880b61e31a7015f0f2670ae6e3d25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for peng-ui 0.3.5
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.