A package for adding scrollbar to surfaces in pygame.
Project description
Pygame-Scrollbar
Overview
The Pygame-Scrollbar package provides classes and utilities to implement scrollable interfaces in Pygame applications. It includes components such as scroll bars, content bars, and event handlers to enable smooth scrolling functionality.
Classes
- ScrollBarManager: Manages the creation and rendering of scroll bars.
- ContentBar: Represents individual content bars within a scrollable interface.
Installation
You can install the package via pip:
pip install pygame-scrollbar
Usage
Here's a basic example demonstrating how to use the Scrollable Interface Package:
import pygame
from scrollable_interface import ScrollBarManager, ContentBar
# Create content bars
content_bar1 = ContentBar(size=(100, 50))
content_bar2 = ContentBar(size=(100, 50))
content_bar3 = ContentBar(size=(100, 50))
content_bar_list = [content_bar1, content_bar2, content_bar3]
# Create a scroll bar manager
scroll_bar_manager = ScrollBarManager(size=(20, 200), content_bar_list=content_bar_list, position=(0, 0))
# In your main loop:
while running:
# Update the window
window.fill((255, 255, 255))
scroll_bar_manager.show(surface=window, window_height=window_height)
pygame.display.update()
Documentation
For detailed documentation, please refer to the github repository.
License
This package is licensed under the MIT License.
Contribution
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pygame_scrollbar-1.0.0.tar.gz
.
File metadata
- Download URL: pygame_scrollbar-1.0.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c7bd8510b659ea2cd2edf89e73bfcf29accfeb4b393c052ce9699e36177f95c |
|
MD5 | ce62303f307cfcaff3e1b1a6c64e6324 |
|
BLAKE2b-256 | ddc4c51b0cbb54b69bcf0b4bd2233d205f9688bb3e88748c8256655423ee3ba9 |
File details
Details for the file pygame_scrollbar-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: pygame_scrollbar-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d97526edfe96940d4fd7b8eda60d334e8f72821950b9e1663145305b409305d |
|
MD5 | b98c9698eda2aa68151d1c0fe3ca7aab |
|
BLAKE2b-256 | 2b9f282c87af3f48a1b11621c2059215605307b578f3650f56783060a1f1ba59 |