Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A button GUI module for Pygame.

Project Description

**A Button UI Element for Pygame**

Pygbutton is a simple button UI that you can add to your Pygame programs.

You can download a few example programs here:

The code to implement it is fairly basic:

import pygbutton
buttonObj = pygbutton.PygButton((50, 50, 60, 30), 'Button Caption')
while True: # main game loop
for event in pygame.event.get(): # event handling loop
if 'click' in buttonObj.handleEvent(event):
pass # Do stuff in response to button click here.
buttonObj.draw(DISPLAYSURFACE) # where DISPLAYSURFACE was the Surface object returned from pygame.display.set_mode()

The full explanation of the code and how it was written can be found in the aboved linked blog post.
Release History

Release History

This version
History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date (12.4 kB) Copy SHA256 Checksum SHA256 Source Oct 31, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting