def on_touch_down(self, touch):
with self.canvas:
if touch.x > self.x_bounds:
self.out_of_bounds = True
#print ('Touch down event out of bounds with x > %s \n' %(self.x_bounds))
pass
elif touch.x < self.x_bounds:
self.canvas.clear()
d = 10
Ellipse(pos=(touch.x - d/2, touch.y - d/2), size=(d,d))
touch.ud['line'] = Line(points=(touch.x, touch.y))
#self.vector_length(touch.ud['line'])
self.x_initial = touch.x
self.y_initial = touch.y
self.out_of_bounds = False
print ('This is the initial x value: %s, \nThis is the initial y value: %s \n\n' %(self.x_initial, self.y_initial))
评论列表
文章目录