@@ -21,12 +21,12 @@ from collections import namedtuple
22from unity8 import get_grid_size
22from unity8 import get_grid_size
23from unity8.shell.emulators import UnityEmulatorBase
23from unity8.shell.emulators import UnityEmulatorBase
24+from unity8.shell import DragMixin
24from autopilot.input import Touch
25from autopilot.input import Touch
25−from time import sleep
27SwipeCoords = namedtuple('SwipeCoords', 'start_x end_x start_y end_y')
27SwipeCoords = namedtuple('SwipeCoords', 'start_x end_x start_y end_y')
29−class Hud(UnityEmulatorBase):
29+class Hud(UnityEmulatorBase, DragMixin):
31 """An emulator that understands the Hud."""
31 """An emulator that understands the Hud."""
@@ -77,15 +77,3 @@ class Hud(UnityEmulatorBase):
77 end_y = main_view.y + int(hud_show_button.y + (hud_show_button.height/2))
77 end_y = main_view.y + int(hud_show_button.y + (hud_show_button.height/2))
79 return SwipeCoords(start_x, end_x, start_y, end_y)
79 return SwipeCoords(start_x, end_x, start_y, end_y)
81− def _drag(self, x1, y1, x2, y2):
84− dx = 1.0 * (x2 - x1) / 100
85− dy = 1.0 * (y2 - y1) / 100
86− for i in range(0, 100):
87− self.touch._finger_move(int(cur_x), int(cur_y))
91− self.touch._finger_move(int(x2), int(y2))