Esempio n. 1
0
 def _reaction_hover(self, pygame_event):
     """Normally, reacts to pygame.MOUSEMOTION, but can be redefined."""
     if self._hovered and not self._help_blitted:
         self._waited = 0
     elif self._hovered and self._help_blitted:
         self._remove_help()
     beeing_hovered = self.collide(pygame_event.pos, self.current_state_key)
     if not self._hovered and beeing_hovered:  # can only change to True
         self._hover()
         if self._help_element:
             self.add_reaction(self._help_reaction)
             functions.add_element_to_current_menu(self) #refresh reaction
     elif self._hovered and not(beeing_hovered):  # can only change to False
         self._unhover()
Esempio n. 2
0
 def _reaction_hover(self, pygame_event):
     """Normally, reacts to pygame.MOUSEMOTION, but can be redefined."""
     if self._hovered and not self._help_blitted:
         self._waited = 0
     elif self._hovered and self._help_blitted:
         self._remove_help()
     beeing_hovered = self.collide(pygame_event.pos, self.current_state_key)
     if not self._hovered and beeing_hovered:  # can only change to True
         self._hover()
         if self._help_element:
             self.add_reaction(self._help_reaction)
             functions.add_element_to_current_menu(self) #refresh reaction
     elif self._hovered and not(beeing_hovered):  # can only change to False
         self._unhover()