Hi all,
After recording the movement of the finger on the screen... How do I do to play the movements registered in the scene?
Cheers
My (naive) code:
import scene
# for recording x and y...
pointX = []
pointY = []
class MyScene(scene.Scene):
def __init__(self, in_dot_color=scene.Color(0, 0, 0, 1)):
super().__init__()
self.dot_color = in_dot_color
self.touch = None
def draw(self):
scene.background(0, 0, 0)
if self.touch:
scene.fill('red')
x, y = self.touch.location
scene.ellipse(x - 50, y - 50, 100, 100)
scene.text(str(x) + ', ' + str(y), 'Futura', 20, 100, 50)
pointX.append(x)
pointY.append(y)
def touch_began(self, touch):
pointX.clear()
pointY.clear()
self.touch = touch
def touch_moved(self, touch):
self.touch = touch
def touch_ended(self, touch):
self.touch = None
scene.run(MyScene(), show_fps=True)