Buttons in pygame: live coding

Hi, there are many modules to make GUI with pygame, I am sure and I will look for them as soon as I can to say if they are good or not. In the meanwhile I made this live recording of me explaining how to use some code I did to make buttons. This, differently from this one here, was made by me from scratch, but it’s nothing but perfect, but it’s interesting I think, pretty customizable, not so nice like this one here, but we can get there. In fact I want to do some changes to the code and maybe I will do other live coding video to discover together how to do it, rather than explaining at the end what I have done. This coul be interesting for 2 reason:

  • you could better understand what I did
  • I can save time to make the tutorial after I made the code

The other side of the coin is that the video will be longer than usual, but if you can deal with that we are pretty good.

All the info about the code are after the video, down here below. If you got questions or comment, write them down here or on the comments on youtube. I like to answer.

The video about making buttons in pygame from GiovanniPython Youtube channel

The Github repository

https://github.com/formazione/pygame_button

The specific version of the file I coded in the video

https://github.com/formazione/pygame_button/blob/master/code/buttons2_beta.py

This post


Subscribe to the newsletter for updates
Tkinter templates
Avatar My youtube channel

Twitter: @pythonprogrammi - python_pygame

Videos

Speech recognition game

Pygame's Platform Game

Other Pygame's posts

Published by pythonprogramming

Started with basic on the spectrum, loved javascript in the 90ies and python in the 2000, now I am back with python, still making some javascript stuff when needed.