Python Forum
[PyGame] Mouse.get_pressed() Overlapping Buttons
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] Mouse.get_pressed() Overlapping Buttons
#1
Hi there.

I'm having trouble creating various menus with Pygame, since some of the menu buttons, although on different menu screens, share the same coordinates. So once one gets pressed, the next screen detects the button still being pressed and automatically triggers as well.

I'm wondering whether the variable imbued with .get_pressed() could be reset to it's original state, aka no buttons active?
I've tried to set a delay, but the issue persists through it, and changing the mouse position after the first press would seem like an unsuitable solution from the viewpoint of the Player - a simplistic menu that has to reset mouse position after every press?

As a note, the different menu screens are in the same general function, split between parts of it, to make navigating easier.
Reply


Messages In This Thread
Mouse.get_pressed() Overlapping Buttons - by KHendrikson - Dec-28-2016, 09:04 AM

Forum Jump:

User Panel Messages

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