Skip to main content

some controls for pygame

Project description

#example

import pygame
pygame.init()
from pybfcontrol.bf_button import BFButton
screen = pygame.display.set_mode((600,420))

def do_click1(btn):
    pygame.display.set_caption('i click %s,ctl id is %s' % (btn._text,btn.ctl_id))    
    btn.text = 'be click'

btn = BFButton(screen, (20,20,160,40),text=u'test',click=do_click1)

while True:
    for event in pygame.event.get():    
        if event.type == pygame.QUIT:        
             pygame.quit()             
             exit()
             
        btn.update(event)
        

    screen.fill((255,255,255))    
    btn.draw()   
    pygame.display.update() 

time

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

pybfcontrol-0.0.2.tar.gz (6.4 kB view hashes)

Uploaded Source

Built Distribution

pybfcontrol-0.0.2-py3-none-any.whl (12.1 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