Skip to main content

GUI widgets toolkit for pygame

Project description

PyGets

PyGets is a lightweight widget toolkit for building small interfaces with pygame.

It provides reusable UI components for rapid prototypes, tools, menus, and simple applications without introducing a larger GUI framework.

Features

  • Button
  • Checkbox
  • Combobox
  • Popup
  • Slider
  • Textbox
  • Togglebutton
  • Built-in theme system with multiple predefined themes

Installation

After publishing to PyPI, users can install PyGets with:

pip install pygets

For local development from this repository:

pip install -e .[dev]

Quick Start

import pygame

from pygets.core.theme import themes
from pygets.widgets import Button

pygame.init()

screen = pygame.display.set_mode((800, 500))
pygame.display.set_caption("PyGets Demo")

font = pygame.font.Font(None, 28)
button = Button(
    x=80,
    y=80,
    font=font,
    screen=screen,
    theme=themes["light"],
    text="Click me",
)

clock = pygame.time.Clock()
running = True

while running:
    clock.tick(60)

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
        if event.type == pygame.MOUSEBUTTONDOWN and event.button == 1:
            if button.rect.collidepoint(event.pos):
                print("Button pressed")

    screen.fill((96, 140, 168))
    button.draw()
    pygame.display.flip()

pygame.quit()

Development

Install development dependencies:

pip install -e .[dev]

Run the test suite:

pytest tests

Build release artifacts:

python -m build
python -m twine check dist/*

Documentation

  • User docs: docs/
  • Examples: examples/
  • Contribution guide: docs/CONTRIBUTING.md
  • Release guide: RELEASING.md

License

PyGets is distributed under the MIT License. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygets-1.0.0.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygets-1.0.0-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file pygets-1.0.0.tar.gz.

File metadata

  • Download URL: pygets-1.0.0.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pygets-1.0.0.tar.gz
Algorithm Hash digest
SHA256 316399e48369ce88461beebcc9f8f5e76f73fea308583ede490f501afc12d89b
MD5 652ad367233fe6f1a5765fc14b5e3d24
BLAKE2b-256 472d92bbf15bec1b1c1d4975819d4111e5d0c60b7087af1b0260c2679926ef31

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygets-1.0.0.tar.gz:

Publisher: publish-pypi.yml on ZentarDev/Pygets

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pygets-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pygets-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pygets-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e564439869fddf0133c70d6aac7127d6af1a540567c19fcea0e4864ec1e3c82
MD5 b536dd8f50bb04b2aaf0c0a708e7ab51
BLAKE2b-256 07deee83710f7f873b6e9a14a4445de989da2f2d17870852aadf8b0420f09a45

See more details on using hashes here.

Provenance

The following attestation bundles were made for pygets-1.0.0-py3-none-any.whl:

Publisher: publish-pypi.yml on ZentarDev/Pygets

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page