Skip to main content

Widgets for use with Pygame

Project description

Pygame Widgets

A helper module for common widgets that may be required in developing applications with Pygame. It supports fully customisable buttons, collections of buttons, textboxes, sliders and many more! If there are any widgets that you would like to see added, please create an issue!

Changes in Pygame Widgets v1.0.0

In v1.0.0, there are some minor changes to the use of the module, which may affect existing projects. This outlines the changes that will affect current users in the new version.

  • As more widgets are added, importing is now different
# Now
from pygame_widgets.button import Button

# Instead of
from pygame_widgets import Button  # Will not work
  • All widgets are now updated (draw and listen) by the update method
import pygame
import pygame_widgets
from pygame_widgets.button import Button

pygame.init()
win = pygame.display.set_mode((600, 600))
button = Button(win, 100, 100, 300, 150)

run = True
while run:
    events = pygame.event.get()
    for event in events:
        if event.type == pygame.QUIT:
            pygame.quit()
            run = False
            quit()

    win.fill((255, 255, 255))

    # Now
    pygame_widgets.update(events)

    # Instead of
    button.listen(events)
    button.draw()

    pygame.display.update()

Prerequisites

Installation

Ensure that Python 3 and pip are installed and added to your environment PATH.

python -m pip install pygame-widgets

Open a Python console and run the following command.

import pygame_widgets

If you receive no errors, the installation was successful.

Usage

For full documentation, see pygamewidgets.readthedocs.io.

How to Contribute

Any contribution to this project would be greatly appreciated. This can include:

  • Finding errors or bugs and creating a new issue
  • Addressing active issues
  • Adding functionality
  • Improving documentation

If applicable, you should make any changes in a forked repository and then create a pull request once the changes are complete and preferably tested if possible.

Note: If writing any code, please attempt to follow the Code Style Guide

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

pygame-widgets-1.0.0.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

pygame_widgets-1.0.0-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

Details for the file pygame-widgets-1.0.0.tar.gz.

File metadata

  • Download URL: pygame-widgets-1.0.0.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.0

File hashes

Hashes for pygame-widgets-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c0caa39ba12277edc276da5ed9503ca73d72f1127d3b4d697b40f48ce8db40ac
MD5 199ebe76c680667c0ecdb1efa479c1bd
BLAKE2b-256 9c6da7e14a9a3d6ecd75babaeccb9dcf9d39cb800eec90ac47ec1f1a23e676e4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pygame_widgets-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 24.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.6.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.0

File hashes

Hashes for pygame_widgets-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 417d2282a0c84041f8b4f62f7bfc84c678bc9ced26480f076a55923437331e2f
MD5 0cc1daa6450104a60dcd61a6a5db16bf
BLAKE2b-256 53c791da482aa7bd29e5e6ce0d3e4c118beaee76f20d24fe7f9a87dd4712d381

See more details on using hashes here.

Supported by

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