@@ -21,12 +21,12 @@ from collections import namedtuple
2121
2222from unity8 import get_grid_size
2323from unity8.shell.emulators import UnityEmulatorBase
24+from unity8.shell import DragMixin
2425from autopilot.input import Touch
25−from time import sleep
2626
2727SwipeCoords = namedtuple('SwipeCoords', 'start_x end_x start_y end_y')
2828
29−class Hud(UnityEmulatorBase):
29+class Hud(UnityEmulatorBase, DragMixin):
3030
3131 """An emulator that understands the Hud."""
3232
@@ -77,15 +77,3 @@ class Hud(UnityEmulatorBase):
7777 end_y = main_view.y + int(hud_show_button.y + (hud_show_button.height/2))
7878
7979 return SwipeCoords(start_x, end_x, start_y, end_y)
80−
81− def _drag(self, x1, y1, x2, y2):
82− cur_x = x1
83− cur_y = y1
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))
88− sleep(0.002)
89− cur_x += dx
90− cur_y += dy
91− self.touch._finger_move(int(x2), int(y2))