Skip to main content

Adds basic UI elements for pygame

Project description

PygButtons

A module made to help in creating a UI by simplifying the creation and handling of basic UI objects (such as Buttons).

Contents

Installation

To install, run: pip install pygbuttons

Dependencies

  • Python => 3.6
  • Pygame => 2.0.1

Usage

To use the Buttons in a program, it is recommended to perform the following steps:

  • Setup
    1. Import the module / the contents of the module.
    2. Set the settings for the Buttons module (framerate, scroll factor, scaling limits) where appropriate
    3. Create the required Buttons
  • While running 4. Pass all (relevant) Pygame.Events to the active Buttons in the input loop 5. Update the Buttons with information which is not event driven (e.g. cursor position) 6. Draw the Buttons to the active screen 7. Repeat

Getting an output from a Button can be done either by binding a function to the Button (which is then automatically executed when a certain action takes place), or by polling the Buttons value / status.

For a practical implementation, see the example.py file.

Support

For support / issues, please visit the issue tracker on GitHub.

Source code available at: https://github.com/Jarno-de-Wit/PygButtons

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

pygbuttons-0.9.0.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

pygbuttons-0.9.0-py3-none-any.whl (37.7 kB view details)

Uploaded Python 3

File details

Details for the file pygbuttons-0.9.0.tar.gz.

File metadata

  • Download URL: pygbuttons-0.9.0.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.0

File hashes

Hashes for pygbuttons-0.9.0.tar.gz
Algorithm Hash digest
SHA256 df4bd5f27fb0a9049248d0bec982dad598a8d5b453c7b9c1199e05a2379b0f2d
MD5 98cdc2df08e0c4a9f92462f92427b91a
BLAKE2b-256 85ce8e9431641406dd3dbea1e80eca971275d1317e0be3e912f5c68f27d52472

See more details on using hashes here.

File details

Details for the file pygbuttons-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: pygbuttons-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 37.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.0

File hashes

Hashes for pygbuttons-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb19ea4b7184ae91951c963a42487b3348b3866b61198647621b6d1284308fe6
MD5 0cf84aafab69b5267f1a2fc20e90486e
BLAKE2b-256 956de4d628eedff4a210fb91e5c375679f840a5ebc009e424deb918fe8ef202d

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