0

So I had an idea of a project today but when I started to do it I noticed I need to make a button which I have no idea how to make with python's pygame library. Can anyone explain to me how to make a button in pygame and how to detect if a user has pressed it?

  • Stack Overflow is not a tutorial, not a debug service and not a code writing service. What have you tried so far? Where are you struggling? Please read [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) and [How to create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example). – Rabbid76 Jan 15 '22 at 09:09
  • I Know how to make a basic button but it's not like functional. Like most buttons press down when they get clicked. But mine is just a rectangle with a text on it. So I want to know how one can make a functional button which responds when it is clicked. – Debarka Naskar Jan 15 '22 at 09:15
  • Can you elaborate? You have to explain this in the question. Anyway, such questions were answered and asked several times. Read the answers to the duplicate questions and read [How to create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example). – Rabbid76 Jan 15 '22 at 09:22
  • Alternatively, use a framework like [pygame-menu](https://pygame-menu.readthedocs.io/en/4.1.3/) – Rabbid76 Jan 15 '22 at 09:24

0 Answers0