Python Forum
[PyGame] Can't get button class to work
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] Can't get button class to work
#2
I'm not quite sure what you are doing with the clicked flag. Regardless, you need to move the initialization of the buttons outside of the while loop because you are creating a new button every frame. Also the get event methods have to be ran under the event loop.

I can give an example when I get to a desktop instead of this small phone. Compare the first code snippet in the tutorial of these issues with your code shown here.
Recommended Tutorials:
Reply


Messages In This Thread
Can't get button class to work - by mzmingle - Nov-21-2018, 10:39 AM
RE: Can't get button class to work - by metulburr - Nov-21-2018, 02:30 PM
RE: Can't get button class to work - by mzmingle - Nov-26-2018, 04:45 PM
RE: Can't get button class to work - by metulburr - Nov-26-2018, 10:06 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] Button class still not working? mzmingle 3 3,152 Jan-16-2019, 04:43 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020