Skip to main content

A simple GUI library for pygame

Project description

py-GameUI

A Python package to use GUI Widgets like Button, Textinput & Slider in pygame.

Install using:

pip install py-GameUI

Documentation

You could check out the docs at https://aman333nolawz.github.io/py-GameUI-docs/

Usage

import pygame

import py_GameUI

W, H = 600, 600
screen = pygame.display.set_mode((W, H))

elements = [
    py_GameUI.Button(
        [10, 10, 100, 100],
        text="Hello world",
        function=lambda: print("You clicked on the button"),
    ),
    py_GameUI.Input_box([10, 150, 150, 20]),
    py_GameUI.Slider(10, 210, 10, 30),
]

while True:
    screen.fill("#1c1c1c")
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            exit()
        for element in elements:
            element.events(event)

    for element in elements:
        element.draw(screen)
    pygame.display.flip()

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

py-GameUI-1.0.7.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

py_GameUI-1.0.7-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file py-GameUI-1.0.7.tar.gz.

File metadata

  • Download URL: py-GameUI-1.0.7.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.0

File hashes

Hashes for py-GameUI-1.0.7.tar.gz
Algorithm Hash digest
SHA256 497df83516f7473db9495bcba95637262d8b0f4fdc79f9beed02d2ea0b27b068
MD5 4ebfefa364804c23f62ccf637b2e11aa
BLAKE2b-256 b4e86076bde60e7b9e9a9c70aec6fee55769755284a825001a3f6965283c7d38

See more details on using hashes here.

File details

Details for the file py_GameUI-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: py_GameUI-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.0

File hashes

Hashes for py_GameUI-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 8e9230b4b9f4e3b94df54a8a72b259a7aa47d2d7f20dba329e3a8619763e1cc2
MD5 594dc7ab7735b8481e3a10035f3c6474
BLAKE2b-256 3fa3c8e5ca5c72b9a1302309b37955e33c482f07821e16e22d1c28a29f7e9e5b

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