Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygame_scrollbar-1.1.0.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

pygame_scrollbar-1.1.0-py3-none-any.whl (7.9 kB view hashes)

Uploaded Python 3

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