Block mouse motions in pygame event grabbing
parent
4e32a7e369
commit
c1792c21a6
1
UI.py
1
UI.py
|
@ -196,7 +196,6 @@ class TestScreen(view.PygView):
|
||||||
self.button = Button(300, 100, 50, 25, text_size=18)
|
self.button = Button(300, 100, 50, 25, text_size=18)
|
||||||
self.textbox = TextBox(300, 250, 200, 100, text="Test")
|
self.textbox = TextBox(300, 250, 200, 100, text="Test")
|
||||||
|
|
||||||
|
|
||||||
self.elements = [self.scroll_menu, self.button, self.textbox]
|
self.elements = [self.scroll_menu, self.button, self.textbox]
|
||||||
|
|
||||||
self.double_clicking = False
|
self.double_clicking = False
|
||||||
|
|
1
view.py
1
view.py
|
@ -19,6 +19,7 @@ class PygView(object):
|
||||||
self.fps = fps
|
self.fps = fps
|
||||||
#self.playtime = 0.0
|
#self.playtime = 0.0
|
||||||
self.font = pygame.font.SysFont('mono', 20, bold=True)
|
self.font = pygame.font.SysFont('mono', 20, bold=True)
|
||||||
|
pygame.event.set_blocked(pygame.MOUSEMOTION)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
"""The mainloop, requires reimplementation
|
"""The mainloop, requires reimplementation
|
||||||
|
|
Loading…
Reference in New Issue