Skip to main content

UI library for pygame

Project description

Guipy

Python Version License

Pygame UI Library built by Casey (@caseyhackerman) and Jason

Installation

pip install guipylib

or with poetry

poetry add guipylib

Components

Button

Button

Dropdown

Dropdown

Live Plot

Live Plot

Plot

Plot

Slider

Slider

Switch

Switch

Textbox

Textbox

Example

import pygame

import colorsys

from guipy.components.slider import Slider
from guipy.manager import GUIManager
from guipy.utils import *

winW = 1280
winH = 720

root = pygame.display.set_mode((winW, winH))

man = GUIManager()

mySlider = Slider(height=50, width=500, thickness=5, radius=12, initial_val=0.4)
mySlider2 = Slider(height=50, width=500, thickness=5, radius=12, initial_val=0)
mySlider3 = Slider(height=50, width=500, thickness=5, radius=12, initial_val=0.5)
mySlider4 = Slider(height=50, width=500, thickness=5, radius=12, initial_val=0.5)

man.add(mySlider, (0, 25))
man.add(mySlider2, (0, 75))
man.add(mySlider3, (0, 125))
man.add(mySlider4, (0, 175))

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

    root.fill(DARK_GREY)

    color = tuple(
        i * 255
        for i in colorsys.hls_to_rgb(mySlider2.val, mySlider3.val, mySlider4.val)
    )
    center = (winW // 2, winH // 2)
    r = 10 + mySlider.val * 100
    pygame.draw.circle(root, color, center, r)
    pygame.draw.circle(root, BLACK, center, r, 3)

    man.update(pygame.mouse.get_pos(), events, root)
    pygame.display.update()

Documentation

Check out some helpful guides and API references here

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

guipylib-0.3.1.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

guipylib-0.3.1-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file guipylib-0.3.1.tar.gz.

File metadata

  • Download URL: guipylib-0.3.1.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.10.6 Linux/5.15.0-1019-azure

File hashes

Hashes for guipylib-0.3.1.tar.gz
Algorithm Hash digest
SHA256 98289c28433a3ff0457bbf2d6705a7b3138cf68fb8a2c909cfcef367065b7756
MD5 f9b8fae8a38bea48bfb83944e0730b92
BLAKE2b-256 1801e644f567bf84b52b1824bc8f50c4bd6759dab5f855ede1d49fa5cb070089

See more details on using hashes here.

File details

Details for the file guipylib-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: guipylib-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.10.6 Linux/5.15.0-1019-azure

File hashes

Hashes for guipylib-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 855d3679ad61b56244f56224196098e540128e5f3167361dd2b1f47780955a70
MD5 d8c3a605dc4fc07295d82afae047d1d6
BLAKE2b-256 3c3a74de85efe3a1434427a3a0982c8c91ab74c196756139ea67c92df142e418

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