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/

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.8.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: py-GameUI-1.0.8.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.8.tar.gz
Algorithm Hash digest
SHA256 396c4fb1135465dd3c377bc64a5f01c20eb65de1d0a436ab41c3dc0bada4798b
MD5 837be200c1b20908fa1ef6657e80cfd2
BLAKE2b-256 b85bf91a0d9d81cae33c8c464a3f3b27fb43579faaf9cc7d835d622d6435f0e6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: py_GameUI-1.0.8-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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 395766e311b90bc203a06a1bac19630b2fd739f2b04c7f328a2ce2ec17912a7f
MD5 727102708f2eb3537b2b7a2f8a1c63ed
BLAKE2b-256 1e42ef40ec18be4b6aad9f0240f66964d6694d8ebc02e6a4e1635dd03bbb3340

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