Skip to content

trymbf/pygameui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyGameUI

PygameUI Logo

A lightweight Python library that makes creating UI elements in Pygame quick and easy.

Version License

Overview

PygameUI is a Python library that simplifies the creation of UI elements like buttons, text, inputs, and more when using Pygame. The library provides many customization options while keeping the implementation straightforward.

Key Features

  • 🎮 Easy Integration - Works seamlessly with existing Pygame projects
  • 🎨 Customizable Components - Extensive styling options for all UI elements
  • Animation Support - Built-in animations for UI elements
  • 🧩 Modular Design - Mix and match components to create complex UI layouts

Quick Start

import pygame
import pygameui

# Initialize
pygame.init()
screen = pygame.display.set_mode((800, 600))

# Create a button
button = pygameui.Button(
    position=(400, 300),
    label="Click Me!",
    color=(100, 150, 250),
    hover_color=(120, 170, 255),
    centered=True
)

# Main loop
running = True
while running:
    # Handle events
    events = pygame.event.get()
    for event in events:
        if event.type == pygame.QUIT:
            running = False
            
    # Update and draw button
    button.update(events)
    
    if button.was_clicked():
        print("Button clicked!")
        
    # Draw
    screen.fill((30, 30, 30))
    button.draw(screen)
    pygame.display.flip()

Documentation

Full documentation is available at https://trymbf.github.io/pygameui/

Installation

  1. Download the PyGameUI Python file from the releases page.
  2. Place the file in your project directory.
  3. Import it with import pygameui.

Installation Example

Available Components

  • Element - Base class for all UI elements with positioning and animation
  • Text - Text display with customizable fonts and styling
  • Button - Interactive buttons with hover and click states
  • Image - Display and manipulate images
  • Input - Text input fields with customizable filters
  • Checkbox - Toggle controls with various styles
  • ProgressBar - Visual indicators for progress or completion
  • DropdownMenu - Selectable dropdown menus
  • Table - Grid-based data display

Getting Help

License

This project is licensed under the terms included in the LICENSE file.

About

Python library that makes making pygame-based-UIs easy!

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published